Error: 'Florence2ForConditionalGeneration' object has no attribute '_supports_sdpa'

#3
by userx1 - opened

Recently a new error showed up I suspect is caused by the transformers lib update:

Exception has occurred: AttributeError
'Florence2ForConditionalGeneration' object has no attribute '_supports_sdpa'
File "C:.......cache\huggingface\modules\transformers_modules\yayayaaa\florence-2-large-ft-moredetailed\ef193e5d50c0fb2e742e2df00d544a8e2c33ed45\modeling_florence2.py", line 2536, in init
super().init(config)
File "C:......\Desktop...\Florence2-1.py", line 25, in
model = AutoModelForCausalLM.from_pretrained(MODEL_NAME, cache_dir="./model_cache", dtype=dtype, trust_remote_code=True).to(device)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'Florence2ForConditionalGeneration' object has no attribute '_supports_sdpa'

The error occurs inside of modeling_florence2.py file.

Last working transformers version:

pip install transformers==4.53.3

Sign up or log in to comment