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)# Load model directly from transformers import AutoProcessor, AutoModelForImageTextToText processor = AutoProcessor.from_pretrained("Xenova/tiny-random-Florence2ForConditionalGeneration", trust_remote_code=True) model = AutoModelForImageTextToText.from_pretrained("Xenova/tiny-random-Florence2ForConditionalGeneration", trust_remote_code=True) - 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
- 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
Upload 6 files
Browse files- onnx/decoder_model.onnx +3 -0
- onnx/decoder_model_merged.onnx +3 -0
- onnx/decoder_with_past_model.onnx +3 -0
- onnx/encoder_model.onnx +3 -0
- onnx/inputs_embeds.onnx +3 -0
- onnx/vision_encoder.onnx +3 -0
onnx/decoder_model.onnx
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:0cb75d493b246d4e89ced0cd0aeca30acb3f4c97084c3da04d5135514cd7fdbf
|
| 3 |
+
size 7804440
|
onnx/decoder_model_merged.onnx
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:ae2578ac2facca9b4987663df5c278dc417e531f088ab074d7a6c5398e713a25
|
| 3 |
+
size 7874221
|
onnx/decoder_with_past_model.onnx
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:6683e374d6e0f575d83ffb1b0a37b2a24785bafe4ed631c5715142a2928f4716
|
| 3 |
+
size 7793897
|
onnx/encoder_model.onnx
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:ce93a9404c8d3604ecdc844aa70e5bef76f5a48c9f74e0a97c1f0a05a0ceafd4
|
| 3 |
+
size 5059922
|
onnx/inputs_embeds.onnx
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:8e052b48fae6adca1828b50f41c69a81d8f2faf596c0f1212c364d37adf0ab57
|
| 3 |
+
size 6565236
|
onnx/vision_encoder.onnx
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:8da3aca6640f349881cd733e85ceb2076671e94dcd36f1c32d9c1efba75857b8
|
| 3 |
+
size 2758068
|