Loading error because of a recent PR

#23
by StarCycle - opened

Hello,

when I try to load the model, I get the following error which seems to be ralated to the recent PR:

  File "/root/autodl-tmp/mimictest/mimictest/Nets/FlorenceMDTNet.py", line 28, in __init__
    self.net = AutoModelForCausalLM.from_pretrained(path, trust_remote_code=True)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/root/transformers/src/transformers/models/auto/auto_factory.py", line 557, in from_pretrained
    cls.register(config.__class__, model_class, exist_ok=True)
  File "/root/transformers/src/transformers/models/auto/auto_factory.py", line 584, in register
    raise ValueError(
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.Florence-2-base.ee1f1f163f352801f3b7af6b2b96e4baaa6ff2ff.configuration_florence2.Florence2Config'> and you passed <class 'transformers_modules.microsoft.Florence-2-base.ceaf371f01ef66192264811b390bccad475a4f02.configuration_florence2.Florence2Config'>. Fix one of those so they match!

Sign up or log in to comment