Image-Text-to-Text
Transformers
Safetensors
llava_next
multimodal
multilingual
vlm
translation
conversational
text-generation-inference
Instructions to use utter-project/TowerVision-9B with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use utter-project/TowerVision-9B with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="utter-project/TowerVision-9B") 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 AutoProcessor, AutoModelForImageTextToText processor = AutoProcessor.from_pretrained("utter-project/TowerVision-9B") model = AutoModelForImageTextToText.from_pretrained("utter-project/TowerVision-9B") 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=40) print(processor.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps
- vLLM
How to use utter-project/TowerVision-9B with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "utter-project/TowerVision-9B" # 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-9B", "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-9B
- SGLang
How to use utter-project/TowerVision-9B 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-9B" \ --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-9B", "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-9B" \ --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-9B", "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-9B with Docker Model Runner:
docker model run hf.co/utter-project/TowerVision-9B
| { | |
| "architectures": [ | |
| "LlavaNextForConditionalGeneration" | |
| ], | |
| "image_grid_pinpoints": [ | |
| [ | |
| 384, | |
| 384 | |
| ], | |
| [ | |
| 384, | |
| 768 | |
| ], | |
| [ | |
| 768, | |
| 384 | |
| ], | |
| [ | |
| 384, | |
| 1152 | |
| ], | |
| [ | |
| 1152, | |
| 384 | |
| ], | |
| [ | |
| 384, | |
| 1536 | |
| ], | |
| [ | |
| 768, | |
| 768 | |
| ], | |
| [ | |
| 1536, | |
| 384 | |
| ], | |
| [ | |
| 384, | |
| 1920 | |
| ], | |
| [ | |
| 1920, | |
| 384 | |
| ], | |
| [ | |
| 384, | |
| 2304 | |
| ], | |
| [ | |
| 768, | |
| 1152 | |
| ], | |
| [ | |
| 1152, | |
| 768 | |
| ], | |
| [ | |
| 2304, | |
| 384 | |
| ] | |
| ], | |
| "image_seq_length": 576, | |
| "image_token_index": 256000, | |
| "local_files_only": true, | |
| "model_type": "llava_next", | |
| "multimodal_projector_bias": true, | |
| "projector_hidden_act": "gelu", | |
| "text_config": { | |
| "add_faster_video": false, | |
| "add_time_instruction": false, | |
| "architectures": [ | |
| "LlavaGemma2ForCausalLM" | |
| ], | |
| "attention_bias": false, | |
| "attention_dropout": 0.0, | |
| "attn_logit_softcapping": 50.0, | |
| "cache_implementation": "hybrid", | |
| "eos_token_id": 107, | |
| "faster_token_stride": 10, | |
| "final_logit_softcapping": 30.0, | |
| "force_sample": false, | |
| "head_dim": 256, | |
| "hidden_act": "gelu_pytorch_tanh", | |
| "hidden_activation": "gelu_pytorch_tanh", | |
| "hidden_size": 3584, | |
| "image_aspect_ratio": "anyres", | |
| "image_crop_resolution": null, | |
| "image_grid_pinpoints": [ | |
| [ | |
| 384, | |
| 384 | |
| ], | |
| [ | |
| 384, | |
| 768 | |
| ], | |
| [ | |
| 768, | |
| 384 | |
| ], | |
| [ | |
| 384, | |
| 1152 | |
| ], | |
| [ | |
| 1152, | |
| 384 | |
| ], | |
| [ | |
| 384, | |
| 1536 | |
| ], | |
| [ | |
| 768, | |
| 768 | |
| ], | |
| [ | |
| 1536, | |
| 384 | |
| ], | |
| [ | |
| 384, | |
| 1920 | |
| ], | |
| [ | |
| 1920, | |
| 384 | |
| ], | |
| [ | |
| 384, | |
| 2304 | |
| ], | |
| [ | |
| 768, | |
| 1152 | |
| ], | |
| [ | |
| 1152, | |
| 768 | |
| ], | |
| [ | |
| 2304, | |
| 384 | |
| ] | |
| ], | |
| "image_split_resolution": null, | |
| "initializer_range": 0.02, | |
| "intermediate_size": 14336, | |
| "max_position_embeddings": 8192, | |
| "mm_hidden_size": 1152, | |
| "mm_newline_position": "grid", | |
| "mm_patch_merge_type": "spatial_unpad", | |
| "mm_projector_lr": null, | |
| "mm_projector_type": "mlp2x_gelu", | |
| "mm_resampler_type": null, | |
| "mm_spatial_pool_mode": "bilinear", | |
| "mm_spatial_pool_stride": null, | |
| "mm_tunable_parts": "mm_vision_tower,mm_mlp_adapter,mm_language_model", | |
| "mm_use_im_patch_token": false, | |
| "mm_use_im_start_end": false, | |
| "mm_vision_select_feature": "patch", | |
| "mm_vision_select_layer": -2, | |
| "mm_vision_tower": "google/siglip2-so400m-patch14-384", | |
| "mm_vision_tower_lr": 2e-06, | |
| "model_type": "gemma2", | |
| "num_attention_heads": 16, | |
| "num_hidden_layers": 42, | |
| "num_key_value_heads": 8, | |
| "pos_skipping_range": 4096, | |
| "query_pre_attn_scalar": 224, | |
| "rms_norm_eps": 1e-06, | |
| "rope_theta": 10000.0, | |
| "sliding_window": 4096, | |
| "tokenizer_model_max_length": 8192, | |
| "tokenizer_padding_side": "right", | |
| "torch_dtype": "bfloat16", | |
| "use_cache": true, | |
| "use_mm_proj": true, | |
| "use_pos_skipping": false, | |
| "vision_tower_pretrained": null, | |
| "vocab_size": 256001 | |
| }, | |
| "tie_word_embeddings": false, | |
| "torch_dtype": "float32", | |
| "transformers_version": "4.52.0", | |
| "use_image_newline_parameter": true, | |
| "vision_config": { | |
| "attention_dropout": 0.0, | |
| "hidden_act": "gelu_pytorch_tanh", | |
| "hidden_size": 1152, | |
| "image_size": 384, | |
| "intermediate_size": 4304, | |
| "layer_norm_eps": 1e-06, | |
| "model_type": "siglip_vision_model", | |
| "num_attention_heads": 16, | |
| "num_channels": 3, | |
| "num_hidden_layers": 26, | |
| "patch_size": 14, | |
| "torch_dtype": "float16", | |
| "vision_use_head": false | |
| }, | |
| "vision_feature_layer": -1, | |
| "vision_feature_select_strategy": "full" | |
| } | |