Run this model with HF Jobs
Run trl-internal-testing/tiny-InklingForConditionalGeneration on Hugging Face's managed compute, monitor its progress, and retrieve the results when it's done.
Paste one of these prompts into your coding agent:
Fine-tune on my dataset
Use HF Jobs and TRL to fine-tune https://huggingface.co/trl-internal-testing/tiny-InklingForConditionalGeneration. Ask me which dataset to train on, then push the fine-tuned model to a new model repo. Run `hf jobs --help` first to learn the CLI.
Run batch inference
Use HF Jobs to run batch inference with https://huggingface.co/trl-internal-testing/tiny-InklingForConditionalGeneration on the inputs in a mounted HF Bucket. Ask me which Bucket to use, then write the outputs back to it and keep each input ID. Run `hf jobs --help` first to learn the CLI.
Evaluate on a benchmark
Use HF Jobs to evaluate https://huggingface.co/trl-internal-testing/tiny-InklingForConditionalGeneration. Ask me which benchmark to run, then save the scores and the per-example results to a new dataset repo. Run `hf jobs --help` first to learn the CLI.
Quantize for lower memory use
Use HF Jobs to create a 4-bit version of https://huggingface.co/trl-internal-testing/tiny-InklingForConditionalGeneration. Push it to a new model repo, then reload it from there and report its memory footprint. Run `hf jobs --help` first to learn the CLI.
Instructions to use trl-internal-testing/tiny-InklingForConditionalGeneration with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use trl-internal-testing/tiny-InklingForConditionalGeneration with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="trl-internal-testing/tiny-InklingForConditionalGeneration") 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("trl-internal-testing/tiny-InklingForConditionalGeneration") model = AutoModelForMultimodalLM.from_pretrained("trl-internal-testing/tiny-InklingForConditionalGeneration", 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 trl-internal-testing/tiny-InklingForConditionalGeneration with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "trl-internal-testing/tiny-InklingForConditionalGeneration" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "trl-internal-testing/tiny-InklingForConditionalGeneration", "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/trl-internal-testing/tiny-InklingForConditionalGeneration
- SGLang
How to use trl-internal-testing/tiny-InklingForConditionalGeneration 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 "trl-internal-testing/tiny-InklingForConditionalGeneration" \ --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": "trl-internal-testing/tiny-InklingForConditionalGeneration", "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 "trl-internal-testing/tiny-InklingForConditionalGeneration" \ --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": "trl-internal-testing/tiny-InklingForConditionalGeneration", "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 trl-internal-testing/tiny-InklingForConditionalGeneration with Docker Model Runner:
docker model run hf.co/trl-internal-testing/tiny-InklingForConditionalGeneration
Upload InklingForConditionalGeneration
Browse filesFiles changed (9)
- .gitattributes+1
- README.mdAdded+9
- chat_template.jinjaAdded+129
- config.jsonAdded+129
- generation_config.jsonAdded+8
- model.safetensorsAdded+3
- processor_config.jsonAdded+47
- tokenizer.jsonAdded+3
- tokenizer_config.jsonAdded+48
32 unmodified lines3334353632 unmodified lines*.zip filter=lfs diff=lfs merge=lfs -text*.zst filter=lfs diff=lfs merge=lfs -text*tfevents* filter=lfs diff=lfs merge=lfs -texttokenizer.json filter=lfs diff=lfs merge=lfs -text123456789---library_name: transformerstags:- trl---
# Tiny InklingForConditionalGeneration
This is a minimal model built for unit tests in the [TRL](https://github.com/huggingface/trl) library.123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129{%- set effort_map = {"none": 0.0, "minimal": 0.1, "low": 0.2, "medium": 0.7, "high": 0.9, "max": 0.99} -%}{%- set role_token = {"user": "<|message_user|>", "assistant": "<|message_model|>", "system": "<|message_system|>", "tool": "<|message_tool|>"} -%}
{%- macro emit_thinking_effort() -%} {%- set eff = reasoning_effort if reasoning_effort is defined and reasoning_effort is not none else 0.9 -%} {%- if eff is string -%} {%- set key = eff | trim -%} {%- if key not in effort_map -%} {{- raise_exception("Unknown reasoning_effort: " ~ eff) -}} {%- endif -%} {%- set num = effort_map[key] -%} {%- else -%} {%- set num = eff | float -%} {%- endif -%} {%- if num < 0.0 or num > 0.99 -%} {{- raise_exception("reasoning_effort must be in [0.0, 0.99]") -}} {%- endif -%} {{- "<|message_system|><|content_text|>Thinking effort level: " -}} {%- if num == 0.0 -%}0{%- else -%}{{ num }}{%- endif -%} {{- "<|end_message|>" -}}{%- endmacro -%}
{%- if tools -%} {%- set tool_state = namespace(specs=[]) -%} {%- for tool in tools -%} {%- set fn = tool.function if tool.function is defined else tool -%} {%- set spec = { "description": (fn.description if fn.description is defined and fn.description else ""), "name": fn.name, "parameters": (fn.parameters if fn.parameters is defined and fn.parameters else {}), "type": (tool.type if tool.type is defined and tool.type else "function"), } -%} {%- set tool_state.specs = tool_state.specs + [spec] -%} {%- endfor -%} {{- "<|message_system|>tool_declare<|content_xml|>" -}} {{- tool_state.specs | tojson(sort_keys=true, separators=(",", ":")) -}} {{- "<|end_message|>" -}}{%- endif -%}
{%- set state = namespace(effort_emitted=false) -%}{%- for message in messages -%} {%- if message.role not in role_token -%} {{- raise_exception("Unknown message role: " ~ message.role) -}} {%- endif -%} {%- if not state.effort_emitted and message.role != "system" -%} {{- emit_thinking_effort() -}} {%- set state.effort_emitted = true -%} {%- endif -%}
{%- set rtok = role_token[message.role] -%}
{%- if message.role == "tool" -%} {%- set tool_name_state = namespace(name="") -%} {%- if message.name is defined and message.name -%} {%- set tool_name_state.name = message.name -%} {%- elif message.tool_call_id is defined and message.tool_call_id -%} {%- for prev in messages -%} {%- if prev.role == "assistant" and prev.tool_calls -%} {%- for tc in prev.tool_calls -%} {%- if tc.id is defined and tc.id == message.tool_call_id and tc.function.name is defined -%} {%- set tool_name_state.name = tc.function.name -%} {%- endif -%} {%- endfor -%} {%- endif -%} {%- endfor -%} {%- endif -%} {{- rtok -}} {%- if tool_name_state.name -%}{{- tool_name_state.name -}}{%- endif -%} {{- "<|content_text|>" -}} {%- if message.content is string -%}{{- message.content -}}{%- endif -%} {{- "<|end_message|>" -}}
{%- else -%} {%- if message.role == "assistant" and message.reasoning_content is defined and message.reasoning_content -%} {{- "<|message_model|><|content_thinking|>" ~ message.reasoning_content ~ "<|end_message|>" -}} {%- endif -%}
{%- if message.content is string -%} {{- rtok ~ "<|content_text|>" ~ message.content ~ "<|end_message|>" -}} {%- elif message.content -%} {%- for part in message.content -%} {%- if part is string -%} {{- rtok ~ "<|content_text|>" ~ part ~ "<|end_message|>" -}} {%- elif part.type is not defined or part.type in ("text", "input_text") -%} {%- set text_part = (part.text if part.text is defined and part.text is string else "") -%} {{- rtok ~ "<|content_text|>" ~ text_part ~ "<|end_message|>" -}} {%- elif part.type in ("image", "input_image", "image_url") -%} {{- rtok ~ "<|content_image|><|unused_200054|><|end_message|>" -}} {%- elif part.type in ("audio", "input_audio", "audio_url") -%} {{- rtok ~ "<|content_audio_input|><|unused_200053|><|audio_end|><|end_message|>" -}} {%- else -%} {{- raise_exception("Unsupported content part type: " ~ part.type) -}} {%- endif -%} {%- endfor -%} {%- endif -%}
{%- if message.role == "assistant" and message.tool_calls -%} {%- for tc in message.tool_calls -%} {%- set fn = tc.function -%} {%- if fn.name is not defined or fn.name is not string -%} {{- raise_exception("tool call function name must be a string") -}} {%- endif -%} {%- set args = fn.arguments if fn.arguments is defined and fn.arguments else {} -%} {%- if args is string -%} {{- raise_exception("tool call arguments must be a parsed object, not a JSON string; canonicalize upstream") -}} {%- endif -%} {%- if args is not mapping -%} {{- raise_exception("tool call arguments must be an object") -}} {%- endif -%} {{- "<|message_model|>" ~ fn.name ~ "<|content_invoke_tool_json|>" -}} {{- '{"name":' ~ (fn.name | tojson(sort_keys=true, separators=(",", ":"))) ~ ',"args":' -}} {{- (args | tojson(sort_keys=true, separators=(",", ":"))) -}} {{- "}<|end_message|>" -}} {%- endfor -%} {%- endif -%}
{%- if message.role == "assistant" -%} {{- "<|content_model_end_sampling|>" -}} {%- endif -%} {%- endif -%}{%- endfor -%}
{%- if not state.effort_emitted -%} {{- emit_thinking_effort() -}}{%- endif -%}
{%- if add_generation_prompt -%} {{- "<|message_model|>" -}}{%- endif -%}123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129{ "architectures": [ "InklingForConditionalGeneration" ], "audio_bos_token_id": 200020, "audio_config": { "audio_mode": "dmel", "bias": false, "decoder_dmodel": 16, "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": 16, "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, 2, 4, 5, 6, 7 ], "num_nextn_predict_layers": 8 }, "text_config": { "attention_dropout": 0.0, "bos_token_id": 1, "chain_hidden_post_norm": false, "conv_kernel_size": 4, "d_rel": 16, "eos_token_id": 2, "final_logit_softcapping": null, "gate_activation": "sigmoid", "head_dim": 8, "hidden_act": "silu", "hidden_size": 16, "initializer_range": 0.02, "intermediate_size": 32, "layer_types": [ "hybrid_sliding", "hybrid_sliding", "hybrid_sliding", "hybrid" ], "local_layer_ids": [ 0, 1, 2 ], "log_scaling_alpha": 0.1, "log_scaling_n_floor": 128000, "logits_mup_width_multiplier": 24.0, "max_position_embeddings": 1048576, "mlp_layer_types": [ "dense", "dense", "sparse", "sparse" ], "model_type": "inkling_text", "moe_intermediate_size": 32, "mtp_hidden_states_first": true, "mtp_local_layer_ids": [ 0, 2, 4, 5, 6, 7 ], "n_routed_experts": 4, "n_shared_experts": 2, "norm_after_topk": true, "num_attention_heads": 4, "num_experts_per_tok": 2, "num_hidden_layers": 4, "num_key_value_heads": 2, "num_mtp_layers": 8, "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": 8, "swa_num_attention_heads": 4, "swa_num_key_value_heads": 2, "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.14.0", "vision_config": { "decoder_dmodel": 16, "hidden_size": 1024, "initializer_range": 0.02, "model_type": "inkling_vision", "n_channels": 3, "n_layers": 4, "num_attention_heads": 16, "num_channels": 3, "patch_size": 40, "rms_norm_eps": 1e-06, "temporal_patch_size": 2, "text_hidden_size": 16, "use_vision_norm": true, "vision_encoder_type": "hmlp" }}12345678{ "_from_model_config": true, "bos_token_id": 1, "eos_token_id": 200006, "output_attentions": false, "output_hidden_states": false, "transformers_version": "5.14.0"}123version https://git-lfs.github.com/spec/v1oid sha256:2e55407d4ed7fdb57b14114288bcf92a8735f7c41734f62a76fe767746f342f6size 628809161234567891011121314151617181920212223242526272829303132333435363738394041424344454647{ "audio_bos_token": "<|content_audio_input|>", "audio_token": "<|unused_200053|>", "dmel_max_value": 2.0, "dmel_min_value": -7.0, "feature_extractor": { "audio_token_duration_s": 0.05, "feature_extractor_type": "InklingFeatureExtractor", "feature_size": 80, "hop_length": 800, "n_fft": 1600, "padding_side": "right", "padding_value": 0.0, "return_attention_mask": true, "sampling_rate": 16000, "window_size": 1600, "window_size_multiplier": 2.0 }, "image_bos_token": "<|content_image|>", "image_processor": { "do_convert_rgb": true, "do_normalize": true, "do_rescale": true, "do_resize": true, "image_mean": [ 0.48145466, 0.4578275, 0.40821073 ], "image_processor_type": "InklingImageProcessor", "image_std": [ 0.26862954, 0.26130258, 0.27577711 ], "resample": 3, "rescale_factor": 0.00392156862745098, "rescale_image_max_upscaled_long_edge": 2048, "size": { "height": 40, "width": 40 } }, "image_token": "<|unused_200054|>", "num_dmel_bins": 16, "processor_class": "InklingProcessor"}123version https://git-lfs.github.com/spec/v1oid sha256:c470271fb7649eef922e660e757b5f076e2a94adc20df7fad7df85c46bc48eacsize 27875796123456789101112131415161718192021222324252627282930313233343536373839404142434445464748{ "audio": "<|audio|>", "audio_end": "<|audio_end|>", "backend": "tokenizers", "begin_of_text": "<|begin_of_text|>", "clean_up_tokenization_spaces": false, "content_audio_input": "<|content_audio_input|>", "content_image": "<|content_image|>", "content_invoke_tool_json": "<|content_invoke_tool_json|>", "content_invoke_tool_text": "<|content_invoke_tool_text|>", "content_model_end_sampling": "<|content_model_end_sampling|>", "content_text": "<|content_text|>", "content_thinking": "<|content_thinking|>", "content_tool_error": "<|content_tool_error|>", "content_xml": "<|content_xml|>", "end_message": "<|end_message|>", "endoftext": "<|endoftext|>", "fix_mistral_regex": false, "is_local": false, "local_files_only": false, "message_model": "<|message_model|>", "message_system": "<|message_system|>", "message_tool": "<|message_tool|>", "message_user": "<|message_user|>", "model_max_length": 1000000000000000019884624838656, "model_specific_special_tokens": { "audio": "<|audio|>", "audio_end": "<|audio_end|>", "begin_of_text": "<|begin_of_text|>", "content_audio_input": "<|content_audio_input|>", "content_image": "<|content_image|>", "content_invoke_tool_json": "<|content_invoke_tool_json|>", "content_invoke_tool_text": "<|content_invoke_tool_text|>", "content_model_end_sampling": "<|content_model_end_sampling|>", "content_text": "<|content_text|>", "content_thinking": "<|content_thinking|>", "content_tool_error": "<|content_tool_error|>", "content_xml": "<|content_xml|>", "end_message": "<|end_message|>", "endoftext": "<|endoftext|>", "message_model": "<|message_model|>", "message_system": "<|message_system|>", "message_tool": "<|message_tool|>", "message_user": "<|message_user|>" }, "processor_class": "InklingProcessor", "tokenizer_class": "TokenizersBackend"}.gitattributes+1
README.mdAdded+9
chat_template.jinjaAdded+129
config.jsonAdded+129
generation_config.jsonAdded+8
model.safetensorsAdded+3
processor_config.jsonAdded+47
tokenizer.jsonAdded+3
tokenizer_config.jsonAdded+48