Image-Text-to-Text
Transformers
Safetensors
llava_next
multimodal
multilingual
vlm
translation
conversational
text-generation-inference
Instructions to use utter-project/TowerVision-2B with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use utter-project/TowerVision-2B with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="utter-project/TowerVision-2B") 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 AutoProcessor, AutoModelForMultimodalLM processor = AutoProcessor.from_pretrained("utter-project/TowerVision-2B") model = AutoModelForMultimodalLM.from_pretrained("utter-project/TowerVision-2B", device_map="auto") 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?"} ] }, ] inputs = processor.apply_chat_template( messages, add_generation_prompt=True, tokenize=True, return_dict=True, return_tensors="pt", ).to(model.device) outputs = model.generate(**inputs, max_new_tokens=256) print(processor.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use utter-project/TowerVision-2B with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "utter-project/TowerVision-2B" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "utter-project/TowerVision-2B", "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/utter-project/TowerVision-2B
- SGLang
How to use utter-project/TowerVision-2B 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 "utter-project/TowerVision-2B" \ --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": "utter-project/TowerVision-2B", "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 "utter-project/TowerVision-2B" \ --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": "utter-project/TowerVision-2B", "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 utter-project/TowerVision-2B with Docker Model Runner:
docker model run hf.co/utter-project/TowerVision-2B
Guilherme Viveiros commited on
Update README.md
Browse files
README.md
CHANGED
|
@@ -3,8 +3,6 @@ library_name: transformers
|
|
| 3 |
tags:
|
| 4 |
- multimodal
|
| 5 |
- multilingual
|
| 6 |
-
- llm
|
| 7 |
-
- vision
|
| 8 |
- vlm
|
| 9 |
- translation
|
| 10 |
language:
|
|
@@ -29,6 +27,7 @@ language:
|
|
| 29 |
base_model:
|
| 30 |
- Unbabel/Tower-Plus-2B
|
| 31 |
pipeline_tag: image-text-to-text
|
|
|
|
| 32 |
---
|
| 33 |
|
| 34 |
# Model Card for TowerVision
|
|
@@ -41,8 +40,6 @@ TowerVision is a family of open-source multilingual vision-language models with
|
|
| 41 |
|
| 42 |
This model card covers the TowerVision family, including the 2B and 9B parameter versions, both in their instruct-tuned (it) and pretrained (pt) variants, with the latter not undergoing instruction tuning.
|
| 43 |
|
| 44 |
-
- **Point of Contact**: X (add some email here)
|
| 45 |
-
- **License**: Apache 2.0
|
| 46 |
- **Model Family**: TowerVision (2B, 9B variants)
|
| 47 |
- **Context length**: 8192 tokens
|
| 48 |
- **Languages**: 20+ languages including European, Asian, and other language families
|
|
@@ -62,6 +59,9 @@ This model card covers the TowerVision family, including the 2B and 9B parameter
|
|
| 62 |
|
| 63 |
## How to Use TowerVision
|
| 64 |
|
|
|
|
|
|
|
|
|
|
| 65 |
### Quick Start with Transformers
|
| 66 |
|
| 67 |
<details open>
|
|
@@ -337,12 +337,6 @@ If you find TowerVision useful in your research, please consider citing the foll
|
|
| 337 |
|
| 338 |
For errors or additional questions about details in this model card, contact the research team.
|
| 339 |
|
| 340 |
-
## Terms of Use
|
| 341 |
-
|
| 342 |
-
We hope that the release of this model will make community-based research efforts more accessible by releasing the weights of highly performant multilingual vision-language models to researchers all over the world.
|
| 343 |
-
|
| 344 |
-
This model is governed by the Apache 2.0 License.
|
| 345 |
-
|
| 346 |
## Acknowledgments
|
| 347 |
|
| 348 |
TowerVision builds upon the excellent work of:
|
|
|
|
| 3 |
tags:
|
| 4 |
- multimodal
|
| 5 |
- multilingual
|
|
|
|
|
|
|
| 6 |
- vlm
|
| 7 |
- translation
|
| 8 |
language:
|
|
|
|
| 27 |
base_model:
|
| 28 |
- Unbabel/Tower-Plus-2B
|
| 29 |
pipeline_tag: image-text-to-text
|
| 30 |
+
license: cc-by-nc-sa-4.0
|
| 31 |
---
|
| 32 |
|
| 33 |
# Model Card for TowerVision
|
|
|
|
| 40 |
|
| 41 |
This model card covers the TowerVision family, including the 2B and 9B parameter versions, both in their instruct-tuned (it) and pretrained (pt) variants, with the latter not undergoing instruction tuning.
|
| 42 |
|
|
|
|
|
|
|
| 43 |
- **Model Family**: TowerVision (2B, 9B variants)
|
| 44 |
- **Context length**: 8192 tokens
|
| 45 |
- **Languages**: 20+ languages including European, Asian, and other language families
|
|
|
|
| 59 |
|
| 60 |
## How to Use TowerVision
|
| 61 |
|
| 62 |
+
When using the model, make sure your prompt is formated correctly!
|
| 63 |
+
Also, we recommend using **bfloat16** rather than **fp32/16**
|
| 64 |
+
|
| 65 |
### Quick Start with Transformers
|
| 66 |
|
| 67 |
<details open>
|
|
|
|
| 337 |
|
| 338 |
For errors or additional questions about details in this model card, contact the research team.
|
| 339 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 340 |
## Acknowledgments
|
| 341 |
|
| 342 |
TowerVision builds upon the excellent work of:
|