Image-Text-to-Text
Transformers
Safetensors
Spanish
inkling2_loop
inkling-2-mini
spanish
conversational
Instructions to use Danielbrdz/Barcenas-Inkling-2-Mini with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Danielbrdz/Barcenas-Inkling-2-Mini with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="Danielbrdz/Barcenas-Inkling-2-Mini") 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)# pip install -U transformers accelerate # Load model directly from transformers import AutoProcessor, AutoModelForMultimodalLM processor = AutoProcessor.from_pretrained("Danielbrdz/Barcenas-Inkling-2-Mini") model = AutoModelForMultimodalLM.from_pretrained("Danielbrdz/Barcenas-Inkling-2-Mini", 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=256) print(processor.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use Danielbrdz/Barcenas-Inkling-2-Mini with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "Danielbrdz/Barcenas-Inkling-2-Mini" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Danielbrdz/Barcenas-Inkling-2-Mini", "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/Danielbrdz/Barcenas-Inkling-2-Mini
- SGLang
How to use Danielbrdz/Barcenas-Inkling-2-Mini 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 "Danielbrdz/Barcenas-Inkling-2-Mini" \ --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": "Danielbrdz/Barcenas-Inkling-2-Mini", "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 "Danielbrdz/Barcenas-Inkling-2-Mini" \ --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": "Danielbrdz/Barcenas-Inkling-2-Mini", "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 Danielbrdz/Barcenas-Inkling-2-Mini with Docker Model Runner:
docker model run hf.co/Danielbrdz/Barcenas-Inkling-2-Mini
Upload config.json
Browse files- config.json +118 -0
config.json
ADDED
|
@@ -0,0 +1,118 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"dtype": "bfloat16",
|
| 3 |
+
"architectures": [
|
| 4 |
+
"Inkling2LoopForConditionalGeneration"
|
| 5 |
+
],
|
| 6 |
+
"model_type": "inkling2_loop",
|
| 7 |
+
"eos_token_id": 200006,
|
| 8 |
+
"text_config": {
|
| 9 |
+
"model_type": "inkling2_loop_text",
|
| 10 |
+
"model_max_length": 1048576,
|
| 11 |
+
"torch_dtype": "bfloat16",
|
| 12 |
+
"hidden_size": 2304,
|
| 13 |
+
"num_hidden_layers": 24,
|
| 14 |
+
"vocab_size": 201024,
|
| 15 |
+
"num_attention_heads": 24,
|
| 16 |
+
"num_key_value_heads": 8,
|
| 17 |
+
"head_dim": 128,
|
| 18 |
+
"d_rel": 16,
|
| 19 |
+
"rel_extent": 1024,
|
| 20 |
+
"q_bias": false,
|
| 21 |
+
"o_bias": false,
|
| 22 |
+
"log_scaling_n_floor": 8192,
|
| 23 |
+
"log_scaling_alpha": 0.1,
|
| 24 |
+
"rms_norm_eps": 1e-06,
|
| 25 |
+
"use_value_norm_no_gamma": true,
|
| 26 |
+
"qk_l2_clip_threshold": 22.627416997969522,
|
| 27 |
+
"rel_l2_clip_threshold": 8.0,
|
| 28 |
+
"local_layer_ids": [
|
| 29 |
+
0,
|
| 30 |
+
1,
|
| 31 |
+
2,
|
| 32 |
+
3,
|
| 33 |
+
4,
|
| 34 |
+
6,
|
| 35 |
+
7,
|
| 36 |
+
8,
|
| 37 |
+
9,
|
| 38 |
+
10,
|
| 39 |
+
12,
|
| 40 |
+
13,
|
| 41 |
+
14,
|
| 42 |
+
15,
|
| 43 |
+
16,
|
| 44 |
+
18,
|
| 45 |
+
19,
|
| 46 |
+
20,
|
| 47 |
+
21,
|
| 48 |
+
22
|
| 49 |
+
],
|
| 50 |
+
"sconv_kernel_size": 4,
|
| 51 |
+
"unpadded_vocab_size": 200058,
|
| 52 |
+
"final_logit_softcapping": 30.0,
|
| 53 |
+
"swa_head_dim": 128,
|
| 54 |
+
"swa_num_attention_heads": 24,
|
| 55 |
+
"swa_num_key_value_heads": 8,
|
| 56 |
+
"sliding_window_size": 1024,
|
| 57 |
+
"n_layers_per_attn_res_block": 6,
|
| 58 |
+
"attn_res_normalize_values": true,
|
| 59 |
+
"n_routed_experts": 128,
|
| 60 |
+
"num_experts_per_tok": 8,
|
| 61 |
+
"n_shared_experts": 0,
|
| 62 |
+
"intermediate_size": 1152,
|
| 63 |
+
"mlp_gate_softcap": 4.0,
|
| 64 |
+
"mlp_up_softcap": 25.0,
|
| 65 |
+
"route_scale": 8.0,
|
| 66 |
+
"use_gate_bias": true,
|
| 67 |
+
"loop_config": {
|
| 68 |
+
"core_start": 6,
|
| 69 |
+
"core_end": 18,
|
| 70 |
+
"num_passes": 3,
|
| 71 |
+
"gate_rank": 64,
|
| 72 |
+
"is_varloop": false
|
| 73 |
+
}
|
| 74 |
+
},
|
| 75 |
+
"vision_config": {
|
| 76 |
+
"model_type": "inkling2_vision",
|
| 77 |
+
"text_hidden_size": 2304,
|
| 78 |
+
"temporal_patch_size": 2,
|
| 79 |
+
"native_patch_size": 20,
|
| 80 |
+
"adapter_merge_size": 2,
|
| 81 |
+
"projection_hidden_dim": 4096,
|
| 82 |
+
"projector_bias": false,
|
| 83 |
+
"hidden_size": 1024,
|
| 84 |
+
"num_hidden_layers": 23,
|
| 85 |
+
"num_attention_heads": 16,
|
| 86 |
+
"mlp_ratio": 4.0,
|
| 87 |
+
"posemb_grid_size": 32,
|
| 88 |
+
"layer_norm_eps": 1e-05
|
| 89 |
+
},
|
| 90 |
+
"mtp_config": {
|
| 91 |
+
"hidden_size": 2304,
|
| 92 |
+
"num_hidden_layers": 3,
|
| 93 |
+
"num_attention_heads": 24,
|
| 94 |
+
"num_key_value_heads": 8,
|
| 95 |
+
"head_dim": 128,
|
| 96 |
+
"intermediate_size": 9216,
|
| 97 |
+
"max_position_embeddings": 1048576,
|
| 98 |
+
"torch_dtype": "bfloat16",
|
| 99 |
+
"q_bias": false,
|
| 100 |
+
"o_bias": false,
|
| 101 |
+
"rms_norm_eps": 1e-06,
|
| 102 |
+
"rope_theta": 1000000.0,
|
| 103 |
+
"local_layer_ids": [
|
| 104 |
+
0,
|
| 105 |
+
2
|
| 106 |
+
],
|
| 107 |
+
"sliding_window_size": 1024,
|
| 108 |
+
"block_size": 8,
|
| 109 |
+
"markov_rank": 256,
|
| 110 |
+
"markov_head_type": "rnn_hidden",
|
| 111 |
+
"target_layer_ids": [
|
| 112 |
+
5,
|
| 113 |
+
23,
|
| 114 |
+
41,
|
| 115 |
+
48
|
| 116 |
+
]
|
| 117 |
+
}
|
| 118 |
+
}
|