Image-Text-to-Text
Transformers
ONNX
Safetensors
Transformers.js
florence2
vision
text-generation
text2text-generation
image-to-text
custom_code
Instructions to use Xenova/tiny-random-Florence2ForConditionalGeneration with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Xenova/tiny-random-Florence2ForConditionalGeneration with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="Xenova/tiny-random-Florence2ForConditionalGeneration", trust_remote_code=True)# pip install -U transformers accelerate # Load model directly from transformers import AutoProcessor, AutoModelForMultimodalLM processor = AutoProcessor.from_pretrained("Xenova/tiny-random-Florence2ForConditionalGeneration", trust_remote_code=True) model = AutoModelForMultimodalLM.from_pretrained("Xenova/tiny-random-Florence2ForConditionalGeneration", trust_remote_code=True, device_map="auto") - Transformers.js
How to use Xenova/tiny-random-Florence2ForConditionalGeneration with Transformers.js:
// npm i @huggingface/transformers import { pipeline } from '@huggingface/transformers'; // Allocate pipeline const pipe = await pipeline('image-text-to-text', 'Xenova/tiny-random-Florence2ForConditionalGeneration'); - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use Xenova/tiny-random-Florence2ForConditionalGeneration with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "Xenova/tiny-random-Florence2ForConditionalGeneration" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Xenova/tiny-random-Florence2ForConditionalGeneration", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/Xenova/tiny-random-Florence2ForConditionalGeneration
- SGLang
How to use Xenova/tiny-random-Florence2ForConditionalGeneration 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 "Xenova/tiny-random-Florence2ForConditionalGeneration" \ --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": "Xenova/tiny-random-Florence2ForConditionalGeneration", "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 "Xenova/tiny-random-Florence2ForConditionalGeneration" \ --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": "Xenova/tiny-random-Florence2ForConditionalGeneration", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use Xenova/tiny-random-Florence2ForConditionalGeneration with Docker Model Runner:
docker model run hf.co/Xenova/tiny-random-Florence2ForConditionalGeneration
Commit History
-
replace
Prathik Rao2377d03
-
Update README.md
Verified signaturec8c158f
-
Update preprocessor_config.json
Verified signatureb81dbf7 -
Update preprocessor_config.json
Verified signature5436b64 -
Update config.json
Verified signature3fe86b7 -
Upload 3 files
Verified signature859c107 -
Remove unnecessary deletion
Verified signatureaa4393c -
Modelling fixes (#2)
Verified signature- Modelling fixes (7e409e9ff1f5b669417a77d8c4eb5d949a76244f) - Update modeling_florence2.py (38dde526b82d731d1fc28c89bb29da5f19d43af9)f6095ea -
Update README.md
Verified signature0abaad4
-
Upload embed_tokens.onnx
Verified signaturec336942 -
Rename onnx/inputs_embeds.onnx to onnx/embed_tokens.onnx
Verified signature64bd84b -
Upload 6 files
Verified signaturef7e2ae4 -
Update config.json
Verified signaturea81076b -
Update README.md
Verified signature03599fb -
Update config.json
Verified signature7c515e0 -
Update config.json (#1)
Verified signature- Update config.json (440cbcc8851c968a4b8fd64311a22cba21ebd243) - Update config.json (77702fd7086740af11fa23d2f4847b12b02e14c2) - Upload 3 files (44bf414818ed3afeb9c5ed9ef1c2cf2ee95c5fa1) - Update config.json (90207ff630d43ec8ec86dd343bcd2e84e79456cc)f69eeaa -
Upload processor
Verified signatured9f6469 -
Upload Florence2ForConditionalGeneration
Verified signaturec7d35e6 -
initial commit
Verified signaturea58cd6a