Image-Text-to-Text
Transformers
Safetensors
llava_onevision2_5
text-generation
multimodal
video-understanding
streaming
llava-onevision
conversational
custom_code
Instructions to use lmms-lab-encoder/LLaVA-OneVision-2.5-4B-Instruct with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use lmms-lab-encoder/LLaVA-OneVision-2.5-4B-Instruct with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="lmms-lab-encoder/LLaVA-OneVision-2.5-4B-Instruct", trust_remote_code=True) messages = [ { "role": "user", "content": [ {"type": "image", "url": "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/p-blog/candy.JPG"}, {"type": "text", "text": "What animal is on the candy?"} ] }, ] pipe(text=messages)# pip install -U transformers accelerate # Load model directly from transformers import AutoModelForCausalLM model = AutoModelForCausalLM.from_pretrained("lmms-lab-encoder/LLaVA-OneVision-2.5-4B-Instruct", trust_remote_code=True, device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use lmms-lab-encoder/LLaVA-OneVision-2.5-4B-Instruct with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "lmms-lab-encoder/LLaVA-OneVision-2.5-4B-Instruct" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "lmms-lab-encoder/LLaVA-OneVision-2.5-4B-Instruct", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Describe this image in one sentence." }, { "type": "image_url", "image_url": { "url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg" } } ] } ] }'Use Docker
docker model run hf.co/lmms-lab-encoder/LLaVA-OneVision-2.5-4B-Instruct
- SGLang
How to use lmms-lab-encoder/LLaVA-OneVision-2.5-4B-Instruct 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 "lmms-lab-encoder/LLaVA-OneVision-2.5-4B-Instruct" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "lmms-lab-encoder/LLaVA-OneVision-2.5-4B-Instruct", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Describe this image in one sentence." }, { "type": "image_url", "image_url": { "url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg" } } ] } ] }'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 "lmms-lab-encoder/LLaVA-OneVision-2.5-4B-Instruct" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "lmms-lab-encoder/LLaVA-OneVision-2.5-4B-Instruct", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Describe this image in one sentence." }, { "type": "image_url", "image_url": { "url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg" } } ] } ] }' - Docker Model Runner
How to use lmms-lab-encoder/LLaVA-OneVision-2.5-4B-Instruct with Docker Model Runner:
docker model run hf.co/lmms-lab-encoder/LLaVA-OneVision-2.5-4B-Instruct
Model card: label input frame rate in streaming table headers
Browse files- README.md +3 -3
- README_CN.md +3 -3
README.md
CHANGED
|
@@ -70,9 +70,9 @@ LLaVA-OneVision-2.5-4B-Instruct is a 4B vision-language model for single-image,
|
|
| 70 |
<table style="width:100%; display:table;">
|
| 71 |
<thead><tr>
|
| 72 |
<th align="left" style="width:40%">Benchmark</th>
|
| 73 |
-
<th align="center" style="width:20%">OV2.5-4B</th>
|
| 74 |
-
<th align="center" style="width:20%">MOSS-VL-Realtime 11B</th>
|
| 75 |
-
<th align="center" style="width:20%">JoyAI-VL-Interaction 8B</th>
|
| 76 |
</tr></thead>
|
| 77 |
<tbody>
|
| 78 |
<tr><td colspan="4" align="left"><b>OVO-Bench</b></td></tr>
|
|
|
|
| 70 |
<table style="width:100%; display:table;">
|
| 71 |
<thead><tr>
|
| 72 |
<th align="left" style="width:40%">Benchmark</th>
|
| 73 |
+
<th align="center" style="width:20%">OV2.5-4B<br>(full frame rate)</th>
|
| 74 |
+
<th align="center" style="width:20%">MOSS-VL-Realtime 11B<br>(1 fps)</th>
|
| 75 |
+
<th align="center" style="width:20%">JoyAI-VL-Interaction 8B<br>(1 fps)</th>
|
| 76 |
</tr></thead>
|
| 77 |
<tbody>
|
| 78 |
<tr><td colspan="4" align="left"><b>OVO-Bench</b></td></tr>
|
README_CN.md
CHANGED
|
@@ -70,9 +70,9 @@ LLaVA-OneVision-2.5-4B-Instruct 是一个 4B 视觉语言模型,支持单图
|
|
| 70 |
<table style="width:100%; display:table;">
|
| 71 |
<thead><tr>
|
| 72 |
<th align="left" style="width:40%">Benchmark</th>
|
| 73 |
-
<th align="center" style="width:20%">OV2.5-4B</th>
|
| 74 |
-
<th align="center" style="width:20%">MOSS-VL-Realtime 11B</th>
|
| 75 |
-
<th align="center" style="width:20%">JoyAI-VL-Interaction 8B</th>
|
| 76 |
</tr></thead>
|
| 77 |
<tbody>
|
| 78 |
<tr><td colspan="4" align="left"><b>OVO-Bench</b></td></tr>
|
|
|
|
| 70 |
<table style="width:100%; display:table;">
|
| 71 |
<thead><tr>
|
| 72 |
<th align="left" style="width:40%">Benchmark</th>
|
| 73 |
+
<th align="center" style="width:20%">OV2.5-4B<br>(全帧率)</th>
|
| 74 |
+
<th align="center" style="width:20%">MOSS-VL-Realtime 11B<br>(1 fps)</th>
|
| 75 |
+
<th align="center" style="width:20%">JoyAI-VL-Interaction 8B<br>(1 fps)</th>
|
| 76 |
</tr></thead>
|
| 77 |
<tbody>
|
| 78 |
<tr><td colspan="4" align="left"><b>OVO-Bench</b></td></tr>
|