Skip to content

Commit

Permalink
Update config class check in auto factory (#29854)
Browse files Browse the repository at this point in the history
  • Loading branch information
Rocketknight1 authored Apr 10, 2024
1 parent f569172 commit d71f5b3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/transformers/models/auto/auto_factory.py
Original file line number Diff line number Diff line change
Expand Up @@ -579,7 +579,7 @@ def register(cls, config_class, model_class, exist_ok=False):
model_class ([`PreTrainedModel`]):
The model to register.
"""
if hasattr(model_class, "config_class") and model_class.config_class != config_class:
if hasattr(model_class, "config_class") and str(model_class.config_class) != str(config_class):
raise ValueError(
"The model class you are passing has a `config_class` attribute that is not consistent with the "
f"config class you passed (model has {model_class.config_class} and you passed {config_class}. Fix "
Expand Down

0 comments on commit d71f5b3

Please sign in to comment.