Instructions to use tiny-random/inkling with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use tiny-random/inkling with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="tiny-random/inkling") 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("tiny-random/inkling") model = AutoModelForMultimodalLM.from_pretrained("tiny-random/inkling", 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 tiny-random/inkling with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "tiny-random/inkling" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "tiny-random/inkling", "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/tiny-random/inkling
- SGLang
How to use tiny-random/inkling 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 "tiny-random/inkling" \ --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": "tiny-random/inkling", "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 "tiny-random/inkling" \ --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": "tiny-random/inkling", "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 tiny-random/inkling with Docker Model Runner:
docker model run hf.co/tiny-random/inkling
File size: 2,829 Bytes
12aaacd | 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 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 | {
"architectures": [
"InklingForConditionalGeneration"
],
"audio_bos_token_id": 200020,
"audio_config": {
"audio_mode": "dmel",
"bias": false,
"decoder_dmodel": 8,
"dmel_max_value": 2.0,
"dmel_min_value": -7.0,
"initializer_range": 0.02,
"mel_vocab_size": 16,
"model_type": "inkling_audio",
"n_mel_bins": 80,
"rms_norm_eps": 1e-06,
"text_hidden_size": 8,
"use_audio_norm": true
},
"audio_token_id": 200053,
"dtype": "bfloat16",
"eos_token_id": 200006,
"image_bos_token_id": 200005,
"image_token_id": 200054,
"model_type": "inkling_mm_model",
"mtp_config": {
"chain_hidden_post_norm": false,
"local_layer_ids": [
0
],
"num_nextn_predict_layers": 1
},
"text_config": {
"attention_dropout": 0.0,
"bos_token_id": 1,
"chain_hidden_post_norm": false,
"conv_kernel_size": 4,
"d_rel": 16,
"dtype": "bfloat16",
"eos_token_id": 2,
"final_logit_softcapping": null,
"gate_activation": "sigmoid",
"head_dim": 32,
"hidden_act": "silu",
"hidden_size": 8,
"initializer_range": 0.02,
"intermediate_size": 32,
"layer_types": [
"hybrid_sliding",
"hybrid"
],
"local_layer_ids": [
0
],
"log_scaling_alpha": 0.1,
"log_scaling_n_floor": 128000,
"logits_mup_width_multiplier": 24.0,
"max_position_embeddings": 1048576,
"mlp_layer_types": [
"dense",
"sparse"
],
"model_type": "inkling_text",
"moe_intermediate_size": 32,
"mtp_hidden_states_first": true,
"mtp_local_layer_ids": [
0
],
"n_routed_experts": 256,
"n_shared_experts": 2,
"norm_after_topk": true,
"num_attention_heads": 8,
"num_experts_per_tok": 6,
"num_hidden_layers": 2,
"num_key_value_heads": 4,
"num_mtp_layers": 1,
"number_of_conv_states": 4,
"o_bias": false,
"pad_token_id": null,
"q_bias": false,
"rel_extent": 1024,
"rms_norm_eps": 1e-06,
"rms_norm_eps_moe_gate": 1e-06,
"route_scale": 8.0,
"shared_expert_sink": true,
"sliding_window_size": 512,
"swa_head_dim": 32,
"swa_num_attention_heads": 8,
"swa_num_key_value_heads": 4,
"unpadded_vocab_size": 200058,
"use_embed_norm": true,
"use_gate_bias": true,
"use_global_scale": true,
"use_sconv": true,
"vocab_size": 201024
},
"transformers_version": "5.15.0.dev0",
"vision_config": {
"decoder_dmodel": 8,
"hidden_size": 1024,
"initializer_range": 0.02,
"model_type": "inkling_vision",
"n_channels": 3,
"n_layers": 2,
"num_attention_heads": 16,
"num_channels": 3,
"patch_size": 40,
"rms_norm_eps": 1e-06,
"temporal_patch_size": 2,
"text_hidden_size": 8,
"use_vision_norm": true,
"vision_encoder_type": "hmlp"
}
}
|