Instructions to use microsoft/Florence-2-large-ft with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use microsoft/Florence-2-large-ft with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="microsoft/Florence-2-large-ft", trust_remote_code=True)# Load model directly from transformers import AutoProcessor, AutoModelForImageTextToText processor = AutoProcessor.from_pretrained("microsoft/Florence-2-large-ft", trust_remote_code=True) model = AutoModelForImageTextToText.from_pretrained("microsoft/Florence-2-large-ft", trust_remote_code=True) - Notebooks
- Google Colab
- Kaggle
- Local Apps
- vLLM
How to use microsoft/Florence-2-large-ft with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "microsoft/Florence-2-large-ft" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "microsoft/Florence-2-large-ft", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/microsoft/Florence-2-large-ft
- SGLang
How to use microsoft/Florence-2-large-ft with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "microsoft/Florence-2-large-ft" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "microsoft/Florence-2-large-ft", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker images
docker run --gpus all \ --shm-size 32g \ -p 30000:30000 \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --env "HF_TOKEN=<secret>" \ --ipc=host \ lmsysorg/sglang:latest \ python3 -m sglang.launch_server \ --model-path "microsoft/Florence-2-large-ft" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "microsoft/Florence-2-large-ft", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use microsoft/Florence-2-large-ft with Docker Model Runner:
docker model run hf.co/microsoft/Florence-2-large-ft
fix: compatibility patches for newer transformers (4.50+ / 5.x)
#44 opened 16 days ago
by
TheeRealDude
fix: add missing torch import
#43 opened 4 months ago
by
MonishSaiR
Fix KV cache compatibility with transformers 4.50+
#42 opened 4 months ago
by
kebabman
SAHI and Florence 2
#41 opened 7 months ago
by
TheMrguiller
Add the `GenerationMixin`
#39 opened 11 months ago
by
iamdanialkamali
Update modeling_florence2.py
#37 opened about 1 year ago
by
ad-astra-video
Adding signatures retrieval
#36 opened about 1 year ago
by
Shumatsurontek
Context for a more accurate caption description.
#35 opened about 1 year ago
by
neocorps
Autoconfig issues
#33 opened over 1 year ago
by
Mediocreatmybest
Update README.md - Spelling
#32 opened over 1 year ago
by
emmanuelgacheru
when will the FLD-5B dataset be released?
π₯ 2
#31 opened over 1 year ago
by
Swimmingfishx
Hahaha, this made me laugh.
π 1
#29 opened over 1 year ago
by
ryzen88
Using multiple prompts during inference
#28 opened over 1 year ago
by
ksooklall
Fix invalid escape sequences
#27 opened over 1 year ago
by
jkawamoto
Can someone explain the suffix for training task 'REFERRING_EXPRESSION_SEGMENTATION'?
1
#26 opened almost 2 years ago
by
liougehooa
Fixed a minor bug with region OCR always returning the first label with an erronious </s>
#25 opened almost 2 years ago
by
Blackroot
Resolving Accuracy Issues in Chinese Output for Florence-2 Fine-Tuned with LoRA
#24 opened almost 2 years ago
by
dqqAAA
Another finetune florence-2 example
π 1
#23 opened almost 2 years ago
by
coldmoon
Are there a way to avoid trust_remote_code=True
π 3
#22 opened almost 2 years ago
by
MoSedky
Fine Tuning for VQA
#21 opened almost 2 years ago
by
ibrahimciftci
Add get_output_embeddings
2
#18 opened almost 2 years ago
by
xray1111
hello, how can i reduce temperature?
#17 opened almost 2 years ago
by
userbox
OPEN_VOCABULARY_DETECTION returns polygons which cannot be displayed
1
#16 opened almost 2 years ago
by
MoritzLaurer
Update README.md
#15 opened almost 2 years ago
by
phanerozoic
Swift now supports inference, training, and deployment of the Florence models.
3
#14 opened almost 2 years ago
by
hu5enpai
What is the prompt format for VQA?
5
#13 opened almost 2 years ago
by
dnhkng
Chinese very bad
15
#12 opened almost 2 years ago
by
lucasjin
Prompt Format for microsoft/Florence-2-large-ft model
π₯π 4
#9 opened almost 2 years ago
by
hitchhiker3010
Fine Tuning
βπ 12
2
#8 opened almost 2 years ago
by
RicoRausch
Onnx version of this model for use with .NET apps
2
#7 opened almost 2 years ago
by
softwareweaver
How to utilize Florence to capture web element coordinates?
π 1
2
#6 opened almost 2 years ago
by
blevlabs
Failed to run on MacBook: requiring flash_attn
π₯ 18
7
#4 opened almost 2 years ago
by
Handgun1773