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 Settings
- 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
Correct pipeline tag
#1
by nielsr HF Staff - opened
README.md
CHANGED
|
@@ -1,22 +1,22 @@
|
|
| 1 |
---
|
| 2 |
-
license: apache-2.0
|
| 3 |
-
pipeline_tag: image-text-to-text
|
| 4 |
-
library_name: transformers
|
| 5 |
base_model:
|
| 6 |
-
|
| 7 |
-
base_model_relation: merge
|
| 8 |
language:
|
| 9 |
-
|
|
|
|
|
|
|
|
|
|
| 10 |
tags:
|
| 11 |
-
|
| 12 |
-
|
|
|
|
| 13 |
---
|
| 14 |
|
| 15 |
# Sa2VA: Marrying SAM2 with LLaVA for Dense Grounded Understanding of Images and Videos
|
| 16 |
|
| 17 |
-
[\[π GitHub\]](https://github.com/magic-research/Sa2VA)
|
| 18 |
-
[\[π Sa2VA paper\]](https://arxiv.org/abs/2501.04001)
|
| 19 |
-
[\[π Quick Start\]](#quick-start)
|
| 20 |
|
| 21 |
|
| 22 |
|
|
@@ -190,8 +190,8 @@ If you find this project useful in your research, please consider citing:
|
|
| 190 |
```BibTeX
|
| 191 |
@article{sa2va,
|
| 192 |
title={Sa2VA: Marrying SAM2 with LLaVA for Dense Grounded Understanding of Images and Videos},
|
| 193 |
-
author={Yuan, Haobo and Li, Xiangtai and Zhang, Tao and Huang, Zilong
|
| 194 |
journal={arXiv preprint},
|
| 195 |
year={2025}
|
| 196 |
}
|
| 197 |
-
```
|
|
|
|
| 1 |
---
|
|
|
|
|
|
|
|
|
|
| 2 |
base_model:
|
| 3 |
+
- OpenGVLab/InternVL2.5-26B
|
|
|
|
| 4 |
language:
|
| 5 |
+
- multilingual
|
| 6 |
+
library_name: transformers
|
| 7 |
+
license: apache-2.0
|
| 8 |
+
pipeline_tag: video-text-to-text
|
| 9 |
tags:
|
| 10 |
+
- Sa2VA
|
| 11 |
+
- custom_code
|
| 12 |
+
base_model_relation: merge
|
| 13 |
---
|
| 14 |
|
| 15 |
# Sa2VA: Marrying SAM2 with LLaVA for Dense Grounded Understanding of Images and Videos
|
| 16 |
|
| 17 |
+
[\\[π GitHub\\]](https://github.com/magic-research/Sa2VA)
|
| 18 |
+
[\\[π Sa2VA paper\\]](https://arxiv.org/abs/2501.04001)
|
| 19 |
+
[\\[π Quick Start\\]](#quick-start)
|
| 20 |
|
| 21 |
|
| 22 |
|
|
|
|
| 190 |
```BibTeX
|
| 191 |
@article{sa2va,
|
| 192 |
title={Sa2VA: Marrying SAM2 with LLaVA for Dense Grounded Understanding of Images and Videos},
|
| 193 |
+
author={Yuan, Haobo and Li, Xiangtai and Zhang, Tao and Huang, Zilong and Xu, Shilin and Ji, Shunping and Tong, Yunhai and Qi, Lu and Feng, Jiashi and Yang, Ming-Hsuan},
|
| 194 |
journal={arXiv preprint},
|
| 195 |
year={2025}
|
| 196 |
}
|
| 197 |
+
```
|