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: remove MMOU test-mini row
Browse files- README.md +0 -1
- README_CN.md +0 -1
README.md
CHANGED
|
@@ -50,7 +50,6 @@ LLaVA-OneVision-2.5-4B-Instruct is a 4B vision-language model for single-image,
|
|
| 50 |
| Video-MME-v2 | 15.5 <sup>64f×330,000</sup> | 16.4 <sup>64f×330,000</sup> | **17.2** <sup>TC64×313,600</sup> |
|
| 51 |
| EgoSchema subset | 68.2 <sup>64f×153,664</sup> | **80.0** <sup>64f×153,664</sup> | -- |
|
| 52 |
| Video-Index 512f | 19.6 <sup>task frames, ≤262,144/f</sup> | **20.0** <sup>task frames, ≤262,144/f</sup> | 19.8 <sup>TC≤256×313,600</sup> |
|
| 53 |
-
| MMOU test-mini | -- | 46.0 <sup>model default</sup> | -- |
|
| 54 |
| **Long video** | | | |
|
| 55 |
| LVBench | 56.5 <sup>2048f×120,000</sup> | **62.0** <sup>950f×200,000</sup> | 61.6 <sup>TC1024×156,800</sup> |
|
| 56 |
| MLVU dev | 73.8 <sup>512f×72,900</sup> | **75.3** <sup>512f×72,900</sup> | -- |
|
|
|
|
| 50 |
| Video-MME-v2 | 15.5 <sup>64f×330,000</sup> | 16.4 <sup>64f×330,000</sup> | **17.2** <sup>TC64×313,600</sup> |
|
| 51 |
| EgoSchema subset | 68.2 <sup>64f×153,664</sup> | **80.0** <sup>64f×153,664</sup> | -- |
|
| 52 |
| Video-Index 512f | 19.6 <sup>task frames, ≤262,144/f</sup> | **20.0** <sup>task frames, ≤262,144/f</sup> | 19.8 <sup>TC≤256×313,600</sup> |
|
|
|
|
| 53 |
| **Long video** | | | |
|
| 54 |
| LVBench | 56.5 <sup>2048f×120,000</sup> | **62.0** <sup>950f×200,000</sup> | 61.6 <sup>TC1024×156,800</sup> |
|
| 55 |
| MLVU dev | 73.8 <sup>512f×72,900</sup> | **75.3** <sup>512f×72,900</sup> | -- |
|
README_CN.md
CHANGED
|
@@ -50,7 +50,6 @@ LLaVA-OneVision-2.5-4B-Instruct 是一个 4B 视觉语言模型,支持单图
|
|
| 50 |
| Video-MME-v2 | 15.5 <sup>64f×330,000</sup> | 16.4 <sup>64f×330,000</sup> | **17.2** <sup>TC64×313,600</sup> |
|
| 51 |
| EgoSchema subset | 68.2 <sup>64f×153,664</sup> | **80.0** <sup>64f×153,664</sup> | -- |
|
| 52 |
| Video-Index 512f | 19.6 <sup>task frames, ≤262,144/f</sup> | **20.0** <sup>task frames, ≤262,144/f</sup> | 19.8 <sup>TC≤256×313,600</sup> |
|
| 53 |
-
| MMOU test-mini | -- | 46.0 <sup>model default</sup> | -- |
|
| 54 |
| **长视频** | | | |
|
| 55 |
| LVBench | 56.5 <sup>2048f×120,000</sup> | **62.0** <sup>950f×200,000</sup> | 61.6 <sup>TC1024×156,800</sup> |
|
| 56 |
| MLVU dev | 73.8 <sup>512f×72,900</sup> | **75.3** <sup>512f×72,900</sup> | -- |
|
|
|
|
| 50 |
| Video-MME-v2 | 15.5 <sup>64f×330,000</sup> | 16.4 <sup>64f×330,000</sup> | **17.2** <sup>TC64×313,600</sup> |
|
| 51 |
| EgoSchema subset | 68.2 <sup>64f×153,664</sup> | **80.0** <sup>64f×153,664</sup> | -- |
|
| 52 |
| Video-Index 512f | 19.6 <sup>task frames, ≤262,144/f</sup> | **20.0** <sup>task frames, ≤262,144/f</sup> | 19.8 <sup>TC≤256×313,600</sup> |
|
|
|
|
| 53 |
| **长视频** | | | |
|
| 54 |
| LVBench | 56.5 <sup>2048f×120,000</sup> | **62.0** <sup>950f×200,000</sup> | 61.6 <sup>TC1024×156,800</sup> |
|
| 55 |
| MLVU dev | 73.8 <sup>512f×72,900</sup> | **75.3** <sup>512f×72,900</sup> | -- |
|