Instructions to use thwri/CogFlorence-2-Large-Freeze with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use thwri/CogFlorence-2-Large-Freeze 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="thwri/CogFlorence-2-Large-Freeze", trust_remote_code=True)# Load model directly from transformers import AutoProcessor, AutoModelForImageTextToText processor = AutoProcessor.from_pretrained("thwri/CogFlorence-2-Large-Freeze", trust_remote_code=True) model = AutoModelForImageTextToText.from_pretrained("thwri/CogFlorence-2-Large-Freeze", trust_remote_code=True) - Notebooks
- Google Colab
- Kaggle
AssertionError: Task token <MORE_DETAILED_CAPTION> should be the only token in the text.
#1
by lrzjason - opened
Try to use the example code but got error with the following message:
...
processing_florence2.py", line 145, in _construct_prompts
assert _text == task_token, f"Task token {task_token} should be the only token in the text."
AssertionError: Task token should be the only token in the text.
Thanks. Corrected the example.
thwri changed discussion status to closed