Instructions to use shi-labs/vpt_OLA-VLM-CLIP-ConvNeXT-Llama3-8b with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use shi-labs/vpt_OLA-VLM-CLIP-ConvNeXT-Llama3-8b with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="shi-labs/vpt_OLA-VLM-CLIP-ConvNeXT-Llama3-8b") 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 AutoModelForCausalLM model = AutoModelForCausalLM.from_pretrained("shi-labs/vpt_OLA-VLM-CLIP-ConvNeXT-Llama3-8b", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use shi-labs/vpt_OLA-VLM-CLIP-ConvNeXT-Llama3-8b with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "shi-labs/vpt_OLA-VLM-CLIP-ConvNeXT-Llama3-8b" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "shi-labs/vpt_OLA-VLM-CLIP-ConvNeXT-Llama3-8b", "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/shi-labs/vpt_OLA-VLM-CLIP-ConvNeXT-Llama3-8b
- SGLang
How to use shi-labs/vpt_OLA-VLM-CLIP-ConvNeXT-Llama3-8b 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 "shi-labs/vpt_OLA-VLM-CLIP-ConvNeXT-Llama3-8b" \ --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": "shi-labs/vpt_OLA-VLM-CLIP-ConvNeXT-Llama3-8b", "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 "shi-labs/vpt_OLA-VLM-CLIP-ConvNeXT-Llama3-8b" \ --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": "shi-labs/vpt_OLA-VLM-CLIP-ConvNeXT-Llama3-8b", "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 shi-labs/vpt_OLA-VLM-CLIP-ConvNeXT-Llama3-8b with Docker Model Runner:
docker model run hf.co/shi-labs/vpt_OLA-VLM-CLIP-ConvNeXT-Llama3-8b
| { | |
| "_name_or_path": "/mnt/projects4jw/jiteshjain_sherlock/models/ABLATE/seed42/SUBMISSION/v_pt_d8-20_s10-18_g12-20_lossd0.5_s0.5_g0.5_textTrue_gen-depth-seg_CLIP-convnext_xxlarge-laion2B-s34B-b82K-augreg-soup-res768_llama3-8b_contw_0.3_lr2e-5_contrastiveTrue_ceFalse_oneformer_attn_causal_n8", | |
| "architectures": [ | |
| "LlavaLlamaForCausalLM" | |
| ], | |
| "attention_bias": false, | |
| "attention_dropout": 0.0, | |
| "attn_mask_type": "causal", | |
| "aux_mode": "gen-depth-seg", | |
| "bos_token_id": 128000, | |
| "contrastive_loss_weight": 0.3, | |
| "depth_estimator": "/mnt/projects4jw/jiteshjain_sherlock/depth_anything_v2_vitl.pth", | |
| "eos_token_id": 128009, | |
| "freeze_mm_mlp_adapter": false, | |
| "hidden_act": "silu", | |
| "hidden_size": 4096, | |
| "image_aspect_ratio": "pad", | |
| "image_depth": { | |
| "depth": 1, | |
| "depth_layer_indices": "8-20", | |
| "depth_loss_weight": 0.5, | |
| "dim_head": 32, | |
| "ff_mult": 1, | |
| "num_heads": 4, | |
| "num_tokens": 576, | |
| "output_dim": 1024, | |
| "use_intermediate_depth": false | |
| }, | |
| "image_gen": { | |
| "depth": 1, | |
| "dim_head": 32, | |
| "ff_mult": 1, | |
| "img_layer_indices": "12-20", | |
| "img_loss_weight": 0.5, | |
| "num_heads": 4, | |
| "num_tokens": 1, | |
| "output_dim": 1024 | |
| }, | |
| "image_generator": "/mnt/projects4jw/jiteshjain_sherlock/stable-diffusion-2-1-unclip", | |
| "image_grid_pinpoints": [ | |
| [ | |
| 336, | |
| 672 | |
| ], | |
| [ | |
| 672, | |
| 336 | |
| ], | |
| [ | |
| 672, | |
| 672 | |
| ], | |
| [ | |
| 1008, | |
| 336 | |
| ], | |
| [ | |
| 336, | |
| 1008 | |
| ] | |
| ], | |
| "image_seg": { | |
| "depth": 1, | |
| "dim_head": 32, | |
| "ff_mult": 1, | |
| "num_heads": 4, | |
| "num_tokens": 576, | |
| "output_dim": 1536, | |
| "seg_layer_indices": "10-18", | |
| "seg_loss_weight": 0.5, | |
| "seg_teacher": "oneformer" | |
| }, | |
| "image_segmentor": "/mnt/projects4jw/jiteshjain_sherlock/oneformer_coco_swin_large", | |
| "initializer_range": 0.02, | |
| "intermediate_size": 14336, | |
| "max_position_embeddings": 8192, | |
| "mlp_bias": false, | |
| "mm_hidden_size": 3072, | |
| "mm_patch_merge_type": "flat", | |
| "mm_projector_lr": null, | |
| "mm_projector_type": "mlp2x_gelu", | |
| "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": "/mnt/projects4jw/jiteshjain_sherlock/CLIP-convnext_xxlarge-laion2B-s34B-b82K-augreg-soup-res768", | |
| "model_type": "llava_llama", | |
| "num_attention_heads": 32, | |
| "num_hidden_layers": 32, | |
| "num_key_value_heads": 8, | |
| "num_task_tokens": 8, | |
| "pass_text_to_aux": true, | |
| "pretraining_tp": 1, | |
| "rms_norm_eps": 1e-05, | |
| "rope_scaling": null, | |
| "rope_theta": 500000.0, | |
| "s2_scales": "336,1008", | |
| "sample_tokens": false, | |
| "task_token_format": "expand_emb", | |
| "tie_word_embeddings": false, | |
| "tokenizer_model_max_length": 4096, | |
| "tokenizer_padding_side": "right", | |
| "torch_dtype": "float32", | |
| "transformers_version": "4.41.1", | |
| "tune_mm_mlp_adapter": false, | |
| "use_cache": true, | |
| "use_ce": false, | |
| "use_contrastive": true, | |
| "use_mm_proj": true, | |
| "use_s2": false, | |
| "vocab_size": 128257 | |
| } | |