Config class problems

#99
by VityaVitalich - opened

Dear maintainers, I encountered the following error when trying to fine-tune model from previously saved checkpoint

ValueError: The model class you are passing has a `config_class` attribute that is not consistent with the config class you passed (model has <class 'transformers_modules.microsoft.Phi-3-mini-4k-
instruct.0a67737cc96d2554230f90338b163bc6380a2a85.configuration_phi3.Phi3Config'> and you passed <class 'transformers_modules.phi_1_3_TTF_1.configuration_phi3.Phi3Config'>. Fix one of those so they match!

It only rises when trust_remote_code=True however, it is a bad fix to the problem on my side.

I have also checked manually with the following lines and we could see the inconsistency clearly

config=AutoConfig.from_pretrained(model_name_or_path)
config.__class__
#transformers.models.phi3.configuration_phi3.Phi3Config

cls = AutoModelForCausalLM
class_ref = config.auto_map[cls.__name__]
get_class_from_dynamic_module(
                class_ref, model_name_or_path, code_revision=None
)
#transformers_modules.microsoft.Phi-3-mini-4k-instruct.0a67737cc96d2554230f90338b163bc6380a2a85.modeling_phi3.Phi3ForCausalLM

Hope you could help me!

Sign up or log in to comment