Instructions to use nyu-visionx/cambrian-phi3-3b with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use nyu-visionx/cambrian-phi3-3b with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="nyu-visionx/cambrian-phi3-3b", trust_remote_code=True) messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoModelForCausalLM model = AutoModelForCausalLM.from_pretrained("nyu-visionx/cambrian-phi3-3b", trust_remote_code=True, dtype="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use nyu-visionx/cambrian-phi3-3b with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "nyu-visionx/cambrian-phi3-3b" # 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-phi3-3b", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/nyu-visionx/cambrian-phi3-3b
- SGLang
How to use nyu-visionx/cambrian-phi3-3b 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-phi3-3b" \ --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-phi3-3b", "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-phi3-3b" \ --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-phi3-3b", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use nyu-visionx/cambrian-phi3-3b with Docker Model Runner:
docker model run hf.co/nyu-visionx/cambrian-phi3-3b
File size: 2,191 Bytes
a2eb68a 92edd4b a2eb68a 9efa67d a2eb68a | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 | {
"_name_or_path": "microsoft/Phi-3-mini-4k-instruct",
"architectures": [
"CambrianPhi3ForCausalLM"
],
"attention_bias": false,
"attention_dropout": 0.0,
"auto_map": {
"AutoConfig": "microsoft/Phi-3-mini-4k-instruct--configuration_phi3.Phi3Config",
"AutoModelForCausalLM": "microsoft/Phi-3-mini-4k-instruct--modeling_phi3.Phi3ForCausalLM"
},
"bos_token_id": 1,
"connector_depth": 3,
"connector_only": false,
"do_sample": true,
"embd_pdrop": 0.0,
"eos_token_id": 32007,
"freeze_mm_mlp_adapter": false,
"hidden_act": "silu",
"hidden_size": 3072,
"image_aspect_ratio": "pad",
"image_position": 13,
"image_token_len": 576,
"initializer_range": 0.02,
"intermediate_size": 8192,
"max_position_embeddings": 4096,
"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_phi3",
"num_attention_heads": 32,
"num_hidden_layers": 32,
"num_key_value_heads": 32,
"num_of_vision_sampler_layers": 10,
"num_query_group": 1,
"original_max_position_embeddings": 4096,
"pad_token_id": 32000,
"query_num_list": [
576
],
"resid_pdrop": 0.0,
"rms_norm_eps": 1e-05,
"rope_scaling": null,
"rope_theta": 10000.0,
"sliding_window": 2047,
"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.39.3",
"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": 32064
}
|