Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix the config class comparison for remote code models #35592

Merged
merged 2 commits into from
Jan 27, 2025

Conversation

Rocketknight1
Copy link
Member

@Rocketknight1 Rocketknight1 commented Jan 9, 2025

The config class comparison previously used str(model_class.config_class), which resulted in mismatches because the actual class was loaded from a cache dir and therefore had the cache dir path as part of its full class name string.

This new test just uses model_class.__name__ which is much less error-prone.

Fixes #35584, related to #29854

@Rocketknight1 Rocketknight1 force-pushed the fix_config_class_comparison branch from 4c0d2ac to 0bb5b32 Compare January 9, 2025 14:46
@Rocketknight1
Copy link
Member Author

cc @ArthurZucker for review!

@HuggingFaceDocBuilderDev

The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update.

@Rocketknight1
Copy link
Member Author

gentle ping @ArthurZucker, and sorry for the spam!

Copy link
Collaborator

@ArthurZucker ArthurZucker left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM thanks! 🤗 time to check if we had other brittle tests like this one!

@Rocketknight1 Rocketknight1 merged commit 63e9c94 into main Jan 27, 2025
26 checks passed
@Rocketknight1 Rocketknight1 deleted the fix_config_class_comparison branch January 27, 2025 18:37
bursteratom pushed a commit to bursteratom/transformers that referenced this pull request Jan 31, 2025
…5592)

* Fix the config class comparison when repeatedly saving and loading remote code models

* once again you have committed your debug breakpoint
elvircrn pushed a commit to elvircrn/transformers that referenced this pull request Feb 13, 2025
…5592)

* Fix the config class comparison when repeatedly saving and loading remote code models

* once again you have committed your debug breakpoint
sbucaille pushed a commit to sbucaille/transformers that referenced this pull request Feb 16, 2025
…5592)

* Fix the config class comparison when repeatedly saving and loading remote code models

* once again you have committed your debug breakpoint
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Malformed config when saving & loading locally custom models
3 participants