Image-to-Text
Transformers
Safetensors
English
florence2
image-text-to-text
image-captioning
custom_code
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
Init _no_split_modules to empty list to allow device_map=auto
Browse files- modeling_florence2.py +2 -0
modeling_florence2.py
CHANGED
|
@@ -2530,6 +2530,8 @@ class Florence2VisionModelWithProjection(Florence2PreTrainedModel):
|
|
| 2530 |
FLORENCE2_START_DOCSTRING,
|
| 2531 |
)
|
| 2532 |
class Florence2ForConditionalGeneration(Florence2PreTrainedModel):
|
|
|
|
|
|
|
| 2533 |
def __init__(self, config: Florence2Config):
|
| 2534 |
super().__init__(config)
|
| 2535 |
assert config.vision_config.model_type == 'davit', 'only DaViT is supported for now'
|
|
|
|
| 2530 |
FLORENCE2_START_DOCSTRING,
|
| 2531 |
)
|
| 2532 |
class Florence2ForConditionalGeneration(Florence2PreTrainedModel):
|
| 2533 |
+
_no_split_modules = []
|
| 2534 |
+
|
| 2535 |
def __init__(self, config: Florence2Config):
|
| 2536 |
super().__init__(config)
|
| 2537 |
assert config.vision_config.model_type == 'davit', 'only DaViT is supported for now'
|