Image-Text-to-Text
Transformers
Safetensors
English
mllama
text-generation-inference
unsloth
conversational
Instructions to use utkarshkingh/llama_3.2-vision_instruct_bpmncoder with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use utkarshkingh/llama_3.2-vision_instruct_bpmncoder with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="utkarshkingh/llama_3.2-vision_instruct_bpmncoder") 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, AutoModelForMultimodalLM processor = AutoProcessor.from_pretrained("utkarshkingh/llama_3.2-vision_instruct_bpmncoder") model = AutoModelForMultimodalLM.from_pretrained("utkarshkingh/llama_3.2-vision_instruct_bpmncoder", 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=40) print(processor.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use utkarshkingh/llama_3.2-vision_instruct_bpmncoder with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "utkarshkingh/llama_3.2-vision_instruct_bpmncoder" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "utkarshkingh/llama_3.2-vision_instruct_bpmncoder", "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/utkarshkingh/llama_3.2-vision_instruct_bpmncoder
- SGLang
How to use utkarshkingh/llama_3.2-vision_instruct_bpmncoder 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 "utkarshkingh/llama_3.2-vision_instruct_bpmncoder" \ --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": "utkarshkingh/llama_3.2-vision_instruct_bpmncoder", "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 "utkarshkingh/llama_3.2-vision_instruct_bpmncoder" \ --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": "utkarshkingh/llama_3.2-vision_instruct_bpmncoder", "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" } } ] } ] }' - Unsloth Studio
How to use utkarshkingh/llama_3.2-vision_instruct_bpmncoder with Unsloth Studio:
Install Unsloth Studio (macOS, Linux, WSL)
curl -fsSL https://unsloth.ai/install.sh | sh # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for utkarshkingh/llama_3.2-vision_instruct_bpmncoder to start chatting
Install Unsloth Studio (Windows)
irm https://unsloth.ai/install.ps1 | iex # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for utkarshkingh/llama_3.2-vision_instruct_bpmncoder to start chatting
Using HuggingFace Spaces for Unsloth
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for utkarshkingh/llama_3.2-vision_instruct_bpmncoder to start chatting
Load model with FastModel
pip install unsloth from unsloth import FastModel model, tokenizer = FastModel.from_pretrained( model_name="utkarshkingh/llama_3.2-vision_instruct_bpmncoder", max_seq_length=2048, ) - Docker Model Runner
How to use utkarshkingh/llama_3.2-vision_instruct_bpmncoder with Docker Model Runner:
docker model run hf.co/utkarshkingh/llama_3.2-vision_instruct_bpmncoder
(Trained with Unsloth)
Browse files- config.json +109 -0
- generation_config.json +13 -0
config.json
ADDED
|
@@ -0,0 +1,109 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"architectures": [
|
| 3 |
+
"MllamaForConditionalGeneration"
|
| 4 |
+
],
|
| 5 |
+
"image_token_index": 128256,
|
| 6 |
+
"model_type": "mllama",
|
| 7 |
+
"pad_token_id": 128004,
|
| 8 |
+
"text_config": {
|
| 9 |
+
"cross_attention_layers": [
|
| 10 |
+
3,
|
| 11 |
+
8,
|
| 12 |
+
13,
|
| 13 |
+
18,
|
| 14 |
+
23,
|
| 15 |
+
28,
|
| 16 |
+
33,
|
| 17 |
+
38
|
| 18 |
+
],
|
| 19 |
+
"dropout": 0,
|
| 20 |
+
"eos_token_id": [
|
| 21 |
+
128001,
|
| 22 |
+
128008,
|
| 23 |
+
128009
|
| 24 |
+
],
|
| 25 |
+
"hidden_act": "silu",
|
| 26 |
+
"hidden_size": 4096,
|
| 27 |
+
"initializer_range": 0.02,
|
| 28 |
+
"intermediate_size": 14336,
|
| 29 |
+
"max_position_embeddings": 131072,
|
| 30 |
+
"model_type": "mllama_text_model",
|
| 31 |
+
"num_attention_heads": 32,
|
| 32 |
+
"num_hidden_layers": 40,
|
| 33 |
+
"num_key_value_heads": 8,
|
| 34 |
+
"rms_norm_eps": 1e-05,
|
| 35 |
+
"rope_scaling": {
|
| 36 |
+
"factor": 8.0,
|
| 37 |
+
"high_freq_factor": 4.0,
|
| 38 |
+
"low_freq_factor": 1.0,
|
| 39 |
+
"original_max_position_embeddings": 8192,
|
| 40 |
+
"rope_type": "llama3"
|
| 41 |
+
},
|
| 42 |
+
"rope_theta": 500000.0,
|
| 43 |
+
"torch_dtype": "bfloat16",
|
| 44 |
+
"use_cache": true,
|
| 45 |
+
"vocab_size": 128256
|
| 46 |
+
},
|
| 47 |
+
"torch_dtype": "bfloat16",
|
| 48 |
+
"transformers_version": "4.50.0",
|
| 49 |
+
"unsloth_fixed": true,
|
| 50 |
+
"unsloth_version": "2025.3.18",
|
| 51 |
+
"vision_config": {
|
| 52 |
+
"attention_heads": 16,
|
| 53 |
+
"hidden_act": "gelu",
|
| 54 |
+
"hidden_size": 1280,
|
| 55 |
+
"image_size": 560,
|
| 56 |
+
"initializer_range": 0.02,
|
| 57 |
+
"intermediate_layers_indices": [
|
| 58 |
+
3,
|
| 59 |
+
7,
|
| 60 |
+
15,
|
| 61 |
+
23,
|
| 62 |
+
30
|
| 63 |
+
],
|
| 64 |
+
"intermediate_size": 5120,
|
| 65 |
+
"max_num_tiles": 4,
|
| 66 |
+
"model_type": "mllama_vision_model",
|
| 67 |
+
"norm_eps": 1e-05,
|
| 68 |
+
"num_channels": 3,
|
| 69 |
+
"num_global_layers": 8,
|
| 70 |
+
"num_hidden_layers": 32,
|
| 71 |
+
"patch_size": 14,
|
| 72 |
+
"supported_aspect_ratios": [
|
| 73 |
+
[
|
| 74 |
+
1,
|
| 75 |
+
1
|
| 76 |
+
],
|
| 77 |
+
[
|
| 78 |
+
1,
|
| 79 |
+
2
|
| 80 |
+
],
|
| 81 |
+
[
|
| 82 |
+
1,
|
| 83 |
+
3
|
| 84 |
+
],
|
| 85 |
+
[
|
| 86 |
+
1,
|
| 87 |
+
4
|
| 88 |
+
],
|
| 89 |
+
[
|
| 90 |
+
2,
|
| 91 |
+
1
|
| 92 |
+
],
|
| 93 |
+
[
|
| 94 |
+
2,
|
| 95 |
+
2
|
| 96 |
+
],
|
| 97 |
+
[
|
| 98 |
+
3,
|
| 99 |
+
1
|
| 100 |
+
],
|
| 101 |
+
[
|
| 102 |
+
4,
|
| 103 |
+
1
|
| 104 |
+
]
|
| 105 |
+
],
|
| 106 |
+
"torch_dtype": "bfloat16",
|
| 107 |
+
"vision_output_dim": 7680
|
| 108 |
+
}
|
| 109 |
+
}
|
generation_config.json
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"bos_token_id": 128000,
|
| 3 |
+
"do_sample": true,
|
| 4 |
+
"eos_token_id": [
|
| 5 |
+
128001,
|
| 6 |
+
128008,
|
| 7 |
+
128009
|
| 8 |
+
],
|
| 9 |
+
"pad_token_id": 128004,
|
| 10 |
+
"temperature": 0.6,
|
| 11 |
+
"top_p": 0.9,
|
| 12 |
+
"transformers_version": "4.50.0"
|
| 13 |
+
}
|