Image-Text-to-Text
Transformers
Safetensors
multilingual
sa2va_chat
feature-extraction
Sa2VA
custom_code
conversational
Instructions to use ByteDance/Sa2VA-26B with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use ByteDance/Sa2VA-26B with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="ByteDance/Sa2VA-26B", 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)# Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("ByteDance/Sa2VA-26B", trust_remote_code=True, dtype="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps
- vLLM
How to use ByteDance/Sa2VA-26B with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "ByteDance/Sa2VA-26B" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "ByteDance/Sa2VA-26B", "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/ByteDance/Sa2VA-26B
- SGLang
How to use ByteDance/Sa2VA-26B 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 "ByteDance/Sa2VA-26B" \ --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": "ByteDance/Sa2VA-26B", "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 "ByteDance/Sa2VA-26B" \ --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": "ByteDance/Sa2VA-26B", "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 ByteDance/Sa2VA-26B with Docker Model Runner:
docker model run hf.co/ByteDance/Sa2VA-26B
Ctrl+K
- 1.52 kB
- 8.48 kB
- 265 Bytes
- 5.61 kB
- 5.55 kB
- 7.01 kB
- 10.4 kB
- 4.3 kB
- 3.46 kB
- 69 Bytes
- 4.99 GB xet
- 4.94 GB xet
- 4.98 GB xet
- 4.88 GB xet
- 4.83 GB xet
- 4.68 GB xet
- 4.68 GB xet
- 4.68 GB xet
- 4.68 GB xet
- 4.68 GB xet
- 4.68 GB xet
- 4.68 GB xet
- 4.68 GB xet
- 4.68 GB xet
- 4.68 GB xet
- 4.68 GB xet
- 4.68 GB xet
- 4.68 GB xet
- 2.77 GB xet
- 3.8 GB xet
- 192 kB
- 14.9 kB
- 61.7 kB
- 74.4 kB
- 38.7 kB
- 176 kB
- 1.54 kB
- 6.96 kB
- 8.79 kB
- 7.79 kB
- 1.48 MB xet
- 4.95 kB