From d71f5b3ea8b4a3a530d0c868e87d57311b177c1c Mon Sep 17 00:00:00 2001 From: Matt Date: Wed, 10 Apr 2024 17:24:32 +0100 Subject: [PATCH] Update config class check in auto factory (#29854) --- src/transformers/models/auto/auto_factory.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/transformers/models/auto/auto_factory.py b/src/transformers/models/auto/auto_factory.py index 98c0e851bcc22d..e53dcab379bb06 100644 --- a/src/transformers/models/auto/auto_factory.py +++ b/src/transformers/models/auto/auto_factory.py @@ -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 "