Instructions to use nyu-visionx/cambrian-8b with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use nyu-visionx/cambrian-8b with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="nyu-visionx/cambrian-8b") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoModelForCausalLM model = AutoModelForCausalLM.from_pretrained("nyu-visionx/cambrian-8b", dtype="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps
- vLLM
How to use nyu-visionx/cambrian-8b with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "nyu-visionx/cambrian-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": "nyu-visionx/cambrian-8b", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/nyu-visionx/cambrian-8b
- SGLang
How to use nyu-visionx/cambrian-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 "nyu-visionx/cambrian-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": "nyu-visionx/cambrian-8b", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'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 "nyu-visionx/cambrian-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": "nyu-visionx/cambrian-8b", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use nyu-visionx/cambrian-8b with Docker Model Runner:
docker model run hf.co/nyu-visionx/cambrian-8b
| { | |
| "_name_or_path": "./Meta-Llama-3-8B-Instruct", | |
| "architectures": [ | |
| "CambrianLlamaForCausalLM" | |
| ], | |
| "attention_bias": false, | |
| "attention_dropout": 0.0, | |
| "bos_token_id": 128000, | |
| "connector_depth": 3, | |
| "connector_only": false, | |
| "eos_token_id": 128001, | |
| "freeze_mm_mlp_adapter": false, | |
| "hidden_act": "silu", | |
| "hidden_size": 4096, | |
| "image_aspect_ratio": "pad", | |
| "image_position": 91, | |
| "image_token_len": 576, | |
| "initializer_range": 0.02, | |
| "intermediate_size": 14336, | |
| "max_position_embeddings": 8192, | |
| "mm_patch_merge_type": "flat", | |
| "mm_projector_lr": null, | |
| "mm_projector_type": "sva", | |
| "mm_use_im_patch_token": false, | |
| "mm_use_im_start_end": false, | |
| "mm_vision_sampler_lr": null, | |
| "mm_vision_select_feature": "patch", | |
| "mm_vision_select_layer": -2, | |
| "mm_vision_tower_aux_list": [ | |
| "siglip/CLIP-ViT-SO400M-14-384", | |
| "openai/clip-vit-large-patch14-336", | |
| "facebook/dinov2-giant-res378", | |
| "clip-convnext-XXL-multi-stage" | |
| ], | |
| "mm_vision_tower_aux_token_len_list": [ | |
| 576, | |
| 576, | |
| 576, | |
| 9216 | |
| ], | |
| "mm_vision_tower_lr": null, | |
| "model_type": "cambrian_llama", | |
| "num_attention_heads": 32, | |
| "num_hidden_layers": 32, | |
| "num_key_value_heads": 8, | |
| "num_of_vision_sampler_layers": 10, | |
| "num_query_group": 1, | |
| "pretraining_tp": 1, | |
| "query_num_list": [ | |
| 576 | |
| ], | |
| "rms_norm_eps": 1e-05, | |
| "rope_scaling": null, | |
| "rope_theta": 500000.0, | |
| "spmd_debug": null, | |
| "spmd_fsdp_sharding": null, | |
| "spmd_mesh": null, | |
| "start_of_vision_sampler_layers": 0, | |
| "stride_of_vision_sampler_layers": 3, | |
| "tie_word_embeddings": false, | |
| "tokenizer_model_max_length": 2048, | |
| "tokenizer_padding_side": "right", | |
| "torch_dtype": "float32", | |
| "transformers_version": "4.40.1", | |
| "tune_mm_mlp_adapter": false, | |
| "unfreeze_mm_vision_tower": false, | |
| "use_cache": true, | |
| "use_mm_proj": true, | |
| "vision_hidden_size": 1024, | |
| "vision_tower_aux_token_len_list": [ | |
| 576, | |
| 576, | |
| 576, | |
| 9216 | |
| ], | |
| "vocab_size": 128256 | |
| } | |