Instructions to use yayayaaa/florence-2-large-ft-moredetailed with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use yayayaaa/florence-2-large-ft-moredetailed with Transformers:
# Use a pipeline as a high-level helper # Warning: Pipeline type "image-to-text" is no longer supported in transformers v5. # You must load the model directly (see below) or downgrade to v4.x with: # 'pip install "transformers<5.0.0' from transformers import pipeline pipe = pipeline("image-to-text", model="yayayaaa/florence-2-large-ft-moredetailed", trust_remote_code=True)# Load model directly from transformers import AutoProcessor, AutoModelForMultimodalLM processor = AutoProcessor.from_pretrained("yayayaaa/florence-2-large-ft-moredetailed", trust_remote_code=True) model = AutoModelForMultimodalLM.from_pretrained("yayayaaa/florence-2-large-ft-moredetailed", trust_remote_code=True) - Notebooks
- Google Colab
- Kaggle
Error: 'Florence2ForConditionalGeneration' object has no attribute '_supports_sdpa'
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