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
Link GitHub repository in model card
Browse files- README.md +1 -1
- README_CN.md +1 -1
README.md
CHANGED
|
@@ -13,7 +13,7 @@ tags:
|
|
| 13 |
|
| 14 |
# LLaVA-OneVision-2.5-4B-Instruct
|
| 15 |
|
| 16 |
-
<img alt="GitHub
|
| 17 |
<img alt="Project page: coming soon" src="https://img.shields.io/badge/Project%20Page-Coming%20soon-2a78d6">
|
| 18 |
<img alt="Technical report: coming soon" src="https://img.shields.io/badge/Technical%20Report-Coming%20soon-b31b1b">
|
| 19 |
<img alt="License" src="https://img.shields.io/badge/License-Apache--2.0-1baf7a">
|
|
|
|
| 13 |
|
| 14 |
# LLaVA-OneVision-2.5-4B-Instruct
|
| 15 |
|
| 16 |
+
<a href="https://github.com/EvolvingLMMs-Lab/LLaVA-OneVision-2.5"><img alt="GitHub" src="https://img.shields.io/badge/GitHub-Code-181717?logo=github"></a>
|
| 17 |
<img alt="Project page: coming soon" src="https://img.shields.io/badge/Project%20Page-Coming%20soon-2a78d6">
|
| 18 |
<img alt="Technical report: coming soon" src="https://img.shields.io/badge/Technical%20Report-Coming%20soon-b31b1b">
|
| 19 |
<img alt="License" src="https://img.shields.io/badge/License-Apache--2.0-1baf7a">
|
README_CN.md
CHANGED
|
@@ -13,7 +13,7 @@ tags:
|
|
| 13 |
|
| 14 |
# LLaVA-OneVision-2.5-4B-Instruct
|
| 15 |
|
| 16 |
-
<img alt="GitHub
|
| 17 |
<img alt="Project page: coming soon" src="https://img.shields.io/badge/Project%20Page-Coming%20soon-2a78d6">
|
| 18 |
<img alt="Technical report: coming soon" src="https://img.shields.io/badge/Technical%20Report-Coming%20soon-b31b1b">
|
| 19 |
<img alt="License" src="https://img.shields.io/badge/License-Apache--2.0-1baf7a">
|
|
|
|
| 13 |
|
| 14 |
# LLaVA-OneVision-2.5-4B-Instruct
|
| 15 |
|
| 16 |
+
<a href="https://github.com/EvolvingLMMs-Lab/LLaVA-OneVision-2.5"><img alt="GitHub" src="https://img.shields.io/badge/GitHub-Code-181717?logo=github"></a>
|
| 17 |
<img alt="Project page: coming soon" src="https://img.shields.io/badge/Project%20Page-Coming%20soon-2a78d6">
|
| 18 |
<img alt="Technical report: coming soon" src="https://img.shields.io/badge/Technical%20Report-Coming%20soon-b31b1b">
|
| 19 |
<img alt="License" src="https://img.shields.io/badge/License-Apache--2.0-1baf7a">
|