Run this model with HF Jobs
Run trl-internal-testing/tiny-MuseSparkForConditionalGeneration 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-MuseSparkForConditionalGeneration. 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-MuseSparkForConditionalGeneration 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-MuseSparkForConditionalGeneration. 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-MuseSparkForConditionalGeneration. 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-MuseSparkForConditionalGeneration with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use trl-internal-testing/tiny-MuseSparkForConditionalGeneration 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-MuseSparkForConditionalGeneration") 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-MuseSparkForConditionalGeneration") model = AutoModelForMultimodalLM.from_pretrained("trl-internal-testing/tiny-MuseSparkForConditionalGeneration", 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-MuseSparkForConditionalGeneration 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-MuseSparkForConditionalGeneration" # 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-MuseSparkForConditionalGeneration", "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-MuseSparkForConditionalGeneration
- SGLang
How to use trl-internal-testing/tiny-MuseSparkForConditionalGeneration 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-MuseSparkForConditionalGeneration" \ --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-MuseSparkForConditionalGeneration", "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-MuseSparkForConditionalGeneration" \ --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-MuseSparkForConditionalGeneration", "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-MuseSparkForConditionalGeneration with Docker Model Runner:
docker model run hf.co/trl-internal-testing/tiny-MuseSparkForConditionalGeneration
Upload MuseSparkForConditionalGeneration
Browse filesFiles changed (6)
12345678966 unmodified lines767778798081828384858687888990919293949516 unmodified lines11211311411511611711811912021 unmodified lines142143144145146147148{%- set tools = tools | default(none) -%}{%- set add_generation_prompt = add_generation_prompt | default(false) -%}{%- set reasoning_effort = reasoning_effort | default('medium') -%}{%- set cutoff_date = cutoff_date | default('2026-01-04') -%}{%- set current_date = current_date | default(strftime_now('%Y-%m-%d') if strftime_now is defined else none) -%}{%- set reasoning_effort_map = {'minimal': 1, 'low': 16, 'medium': 64, 'high': 256, 'xhigh': 512} -%}{#- Neutralise control sequences in caller-supplied text so it cannot betokenized as structure. "<|" is broken because every special token has the66 unmodified lines{{- '</atem:invoke>\n</atem:function_calls>' -}}{%- endmacro -%}{%- macro render_tool_defs(tools) -%}{{- 'In this environment you have access to a set of tools you can use to answer the user\'s question.\n\n' -}}{{- 'You can invoke a function by writing a "<atem:function_calls>" block like the following as part of your reply to the user:\n' -}}{{- '<atem:function_calls>\n<atem:invoke name="$FUNCTION_NAME">\n<atem:parameter name="$PARAMETER_NAME">$PARAMETER_VALUE</atem:parameter>\n...\n</atem:invoke>\n</atem:function_calls>\n\n' -}}{{- 'String and scalar parameters should be specified as is, while lists and objects should use JSON format. Note that spaces for string values are not stripped. The output is not expected to be valid XML and is parsed with regular expressions.\n' -}}{{- 'Here are the functions available in JSONSchema format:\n' -}}{{- '// Tool metadata\n{"name": "", "description": ""}\n' -}}{{- '// Function schemas' -}}{%- for tool in tools -%}{%- set fn = tool.function if tool.function is defined else tool -%}{{- '\n{"name": ' -}}{{- fn.name | tojson -}}{{- ', "description": ' -}}{{- (fn.description if fn.description is defined and fn.description else '') | tojson -}}{{- ', "parameters": ' -}}{{- (fn.parameters if fn.parameters is defined and fn.parameters else {}) | tojson -}}{{- '}' -}}{%- endfor -%}{{- '\n\n' -}}{{- 'Here are examples of how to call functions in the tool set. To make parallel tool calls, emit each call as its own message (one tool call per message) in consecutive messages, as shown below:\n' -}}{{- '(If the tool namespace is not specified, invoke the function directly as `example_function_name_1` rather than `example_tool_name_1.example_function_name_1`)\n\n' -}}16 unmodified lines{%- set rns.recipients = rns.recipients + ['"commentary"'] -%}{{- '- "commentary": user-visible intermediate updates while the assistant will continue working, including messages sent to the user before or between tool calls.\n' -}}{%- if tools -%}{%- set first_tool = tools | first -%}{%- set first_fn = (first_tool.function if first_tool.function is defined else first_tool).name -%}{%- set rns.recipients = rns.recipients + ['"[func_name] (e.g., ' ~ esc_header(first_fn) ~ ')"'] -%}{{- '- "tool" or "[tool name]": the name of the tool to call.\n' -}}{%- endif -%}{%- set rns.recipients = rns.recipients + ['"user"'] -%}21 unmodified lines{%- if tools -%}{%- set sys.parts = sys.parts + [render_tool_defs(tools) | trim] -%}{%- endif -%}{%- if reasoning_effort in reasoning_effort_map and 'reasoning strength:' not in ((ns.instructions if ns.instructions else '') | lower) -%}{%- set sys.parts = sys.parts + ['Reasoning strength: ' ~ reasoning_effort_map[reasoning_effort] ~ '.'] -%}{%- endif -%}{%- set sys.parts = sys.parts + [render_valid_recipients(tools) | trim] -%}1234567891011121366 unmodified lines808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514616 unmodified lines16316416516616716816917017117217317417517617721 unmodified lines199200201202203204205{%- set tools = tools | default(none) -%}{%- set add_generation_prompt = add_generation_prompt | default(false) -%}{%- set reasoning_effort = reasoning_effort | default('xhigh', true) -%}{%- set cutoff_date = cutoff_date | default('2026-01-04') -%}{%- set current_date = current_date | default(strftime_now('%Y-%m-%d') if strftime_now is defined else none) -%}{%- set reasoning_effort_map = {'low': 8, 'medium': 32, 'high': 256, 'xhigh': 512} -%}{%- if not (reasoning_effort is string and reasoning_effort in reasoning_effort_map) -%}{{- raise_exception('Unsupported reasoning_effort: ' ~ reasoning_effort ~ '. Expected one of: low, medium, high, xhigh.') -}}{%- endif -%}{%- set deferred_render_mode = deferred_render_mode | default('tool_name_and_description') -%}{#- Neutralise control sequences in caller-supplied text so it cannot betokenized as structure. "<|" is broken because every special token has the66 unmodified lines{{- '</atem:invoke>\n</atem:function_calls>' -}}{%- endmacro -%}{#- One function line, as the training renderer prints it. Deferred: name plus description and annotation(tool_name_and_description) or annotation only (tool_name_only). Full: "additionalProperties": false is addedwhen the schema lacks it, and empty parameters become an empty object schema. -#}{%- macro fn_line(name, fn, deferred) -%}{%- set desc = fn.description if fn.description is defined and fn.description else '' -%}{%- set p = fn.parameters if fn.parameters is defined and fn.parameters else {} -%}{%- if deferred -%}{%- set desc = ('' if deferred_render_mode == 'tool_name_only' else desc ~ ' ') ~ '[deferred: use tool_search to load full schema]' -%}{{- '\n{"name": ' ~ esc(name | tojson) ~ ', "description": ' ~ esc(desc | tojson) ~ ', "defer_loading": true}' -}}{%- else -%}{%- if p is mapping and p | length == 0 -%}{%- set p = '{"type": "object", "properties": {}, "additionalProperties": false}' -%}{%- elif p is mapping and 'additionalProperties' not in p -%}{%- set p = (p | tojson)[:-1] ~ ', "additionalProperties": false}' -%}{%- else -%}{%- set p = p | tojson -%}{%- endif -%}{{- '\n{"name": ' ~ esc(name | tojson) ~ ', "description": ' ~ esc(desc | tojson) ~ ', "parameters": ' ~ esc(p) ~ '}' -}}{%- endif -%}{%- endmacro -%}{#- tools: OpenAI function tools, plus namespace tools {"type": "namespace", "name", "description", "defer_loading","tools": [function, ...]}. In a deferred namespace, functions without their own flag inherit the deferral; onlywhen some are true and some explicitly false do the explicitly eager ones keep their full schema. -#}{%- macro render_tool_defs(tools) -%}{{- 'In this environment you have access to a set of tools you can use to answer the user\'s question.\n\n' -}}{{- 'You can invoke a function by writing a "<atem:function_calls>" block like the following as part of your reply to the user:\n' -}}{{- '<atem:function_calls>\n<atem:invoke name="$FUNCTION_NAME">\n<atem:parameter name="$PARAMETER_NAME">$PARAMETER_VALUE</atem:parameter>\n...\n</atem:invoke>\n</atem:function_calls>\n\n' -}}{{- 'String and scalar parameters should be specified as is, while lists and objects should use JSON format. Note that spaces for string values are not stripped. The output is not expected to be valid XML and is parsed with regular expressions.\n' -}}{{- 'Here are the functions available in JSONSchema format:\n' -}}{%- set td = namespace(meta='', fns='', loose=false) -%}{%- for tool in tools -%}{%- if tool.type is defined and tool.type == 'namespace' -%}{%- set ns_deferred = tool.defer_loading is defined and tool.defer_loading -%}{%- set ns_desc = tool.description if tool.description is defined and tool.description else '' -%}{%- set members = tool.tools if tool.tools is defined and tool.tools else [] -%}{%- set flags = namespace(t=false, f=false) -%}{%- for m in members -%}{%- set d = (m.function if m.function is defined else m).defer_loading -%}{%- set flags.t = flags.t or d is not sameas false -%}{%- set flags.f = flags.f or d is sameas false -%}{%- endfor -%}{%- if ns_deferred -%}{%- set ns_desc = '[deferred: use tool_search to load descriptions and schemas]' if deferred_render_mode == 'tool_name_only' else (ns_desc ~ ' ' if ns_desc else '') ~ '[deferred: use tool_search to discover functions]' -%}{%- endif -%}{%- set td.meta = td.meta ~ '\n{"name": ' ~ esc(tool.name | tojson) ~ ', "description": ' ~ esc(ns_desc | tojson) ~ (', "has_deferred_functions": true}' if ns_deferred else '}') -%}{%- for m in members -%}{%- set mfn = m.function if m.function is defined else m -%}{%- set eager = flags.t and flags.f and mfn.defer_loading is defined and mfn.defer_loading is sameas false -%}{%- if not ns_deferred or eager or deferred_render_mode == 'tool_name_only' -%}{%- set td.fns = td.fns ~ fn_line(tool.name ~ '.' ~ mfn.name, mfn, (not eager) if ns_deferred else (mfn.defer_loading is defined and mfn.defer_loading)) -%}{%- endif -%}{%- endfor -%}{%- else -%}{%- set fn = tool.function if tool.function is defined else tool -%}{%- set td.meta = td.meta ~ ('' if td.loose else '\n{"name": "", "description": ""}') -%}{%- set td.loose = true -%}{%- set td.fns = td.fns ~ fn_line(fn.name, fn, fn.defer_loading is defined and fn.defer_loading) -%}{%- endif -%}{%- endfor -%}{{- '// Tool metadata' ~ td.meta ~ '\n// Function schemas' ~ td.fns -}}{{- '\n\n' -}}{{- 'Here are examples of how to call functions in the tool set. To make parallel tool calls, emit each call as its own message (one tool call per message) in consecutive messages, as shown below:\n' -}}{{- '(If the tool namespace is not specified, invoke the function directly as `example_function_name_1` rather than `example_tool_name_1.example_function_name_1`)\n\n' -}}16 unmodified lines{%- set rns.recipients = rns.recipients + ['"commentary"'] -%}{{- '- "commentary": user-visible intermediate updates while the assistant will continue working, including messages sent to the user before or between tool calls.\n' -}}{%- if tools -%}{%- set rt = namespace(first=none, ns=[]) -%}{%- for tool in tools -%}{%- if tool.type is defined and tool.type == 'namespace' -%}{%- set rt.ns = rt.ns + ['"' ~ esc_header(tool.name) ~ '.*"'] -%}{%- elif rt.first is none -%}{%- set rt.first = (tool.function if tool.function is defined else tool).name -%}{%- endif -%}{%- endfor -%}{%- set rns.recipients = rns.recipients + (['"[func_name] (e.g., ' ~ esc_header(rt.first) ~ ')"'] if rt.first is not none else []) + rt.ns -%}{{- '- "tool" or "[tool name]": the name of the tool to call.\n' -}}{%- endif -%}{%- set rns.recipients = rns.recipients + ['"user"'] -%}21 unmodified lines{%- if tools -%}{%- set sys.parts = sys.parts + [render_tool_defs(tools) | trim] -%}{%- endif -%}{%- if 'reasoning strength:' not in ((ns.instructions if ns.instructions else '') | lower) -%}{%- set sys.parts = sys.parts + ['Reasoning strength: ' ~ reasoning_effort_map[reasoning_effort] ~ '.'] -%}{%- endif -%}{%- set sys.parts = sys.parts + [render_valid_recipients(tools) | trim] -%}
18 unmodified lines192021222324257 unmodified lines3334353637383981 unmodified lines1211221231241251261273 unmodified lines1311321331341351369 unmodified lines1461471481491501511526 unmodified lines15916016116216316416518 unmodified lines],"initializer_range": 0.02,"mlp_ratio": 2.0,"model_type": "musespark1x_omni_audio","num_hidden_layers": 4,"out_hidden_size": 64,"patch_sizes": [7 unmodified lines"audio_token_id": 200038,"dtype": "bfloat16","image_token_id": 200092,"model_type": "musespark1x_omni","out_hidden_size": 128,"projector_hidden_act": "gelu","projector_hidden_size": 32,81 unmodified lines"sparse","sparse"],"model_type": "musespark1x_omni_text","moe_hidden_size": 16,"moe_intermediate_size": 32,"num_attention_heads": 4,3 unmodified lines"num_local_experts": 16,"num_shared_experts": 0,"output_multiplier": 0.17677669529663687,"pad_token_id": 200018,"post_norm_eps": 1e-08,"qk_scale_factor": 5.4730064863875,9 unmodified lines"use_cache": true,"vocab_size": 202048},"transformers_version": "5.18.0.dev0","video_token_id": 200091,"vision_config": {"hidden_act": "gelu",6 unmodified lines],"max_position_embeddings": 1024,"merge_size": 2,"model_type": "musespark1x_omni_vision","num_attention_heads": 4,"num_hidden_layers": 2,"patch_size": 14,18 unmodified lines192021222324257 unmodified lines3334353637383981 unmodified lines1211221231241251261273 unmodified lines1311321331341351361379 unmodified lines1471481491501511521536 unmodified lines16016116216316416516618 unmodified lines],"initializer_range": 0.02,"mlp_ratio": 2.0,"model_type": "muse_spark_audio","num_hidden_layers": 4,"out_hidden_size": 64,"patch_sizes": [7 unmodified lines"audio_token_id": 200038,"dtype": "bfloat16","image_token_id": 200092,"model_type": "muse_spark","out_hidden_size": 128,"projector_hidden_act": "gelu","projector_hidden_size": 32,81 unmodified lines"sparse","sparse"],"model_type": "muse_spark_text","moe_hidden_size": 16,"moe_intermediate_size": 32,"num_attention_heads": 4,3 unmodified lines"num_local_experts": 16,"num_shared_experts": 0,"output_multiplier": 0.17677669529663687,"output_router_logits": false,"pad_token_id": 200018,"post_norm_eps": 1e-08,"qk_scale_factor": 5.4730064863875,9 unmodified lines"use_cache": true,"vocab_size": 202048},"transformers_version": "5.19.0.dev0","video_token_id": 200091,"vision_config": {"hidden_act": "gelu",6 unmodified lines],"max_position_embeddings": 1024,"merge_size": 2,"model_type": "muse_spark_vision","num_attention_heads": 4,"num_hidden_layers": 2,"patch_size": 14,
8 unmodified lines910111213148 unmodified lines"pad_token_id": 200018,"temperature": 1.0,"top_k": 64,"top_p": 0.95,"transformers_version": "5.18.0.dev0"}8 unmodified lines910111213148 unmodified lines"pad_token_id": 200018,"temperature": 1.0,"top_k": 64,"top_p": 1,"transformers_version": "5.19.0.dev0"}
123version https://git-lfs.github.com/spec/v1oid sha256:0eca1a0351ae70d60e5c7b1031984afbb33f61c1aef279b139b417a45194f6b0size 52154128123version https://git-lfs.github.com/spec/v1oid sha256:10f92659782580ffd54363ad540da89f3203a176879a15ec905d125c47f95356size 52154128
38 unmodified lines3940414243444 unmodified lines49505152535455565738 unmodified lines"do_resize": true,"do_sample_frames": true,"fps": 2.0,"image_mean": [0.5,0.5,4 unmodified lines0.5,0.5],"max_video_frame_tokens": 144,"merge_size": 2,"num_frames": 96,"patch_size": 14,"resample": 1,"rescale_factor": 0.00392156862745098,38 unmodified lines394041424344454 unmodified lines50515253545556575838 unmodified lines"do_resize": true,"do_sample_frames": true,"fps": 2.0,"frame_timestamp_format": "Time: {timestamp:.2f}s","image_mean": [0.5,0.5,4 unmodified lines0.5,0.5],"max_video_frame_tokens": 256,"merge_size": 2,"num_frames": 600,"patch_size": 14,"resample": 1,"rescale_factor": 0.00392156862745098,
2 unmodified lines34567892 unmodified lines"bos_token": "<|begin_of_text|>","clean_up_tokenization_spaces": false,"eos_token": "<|end_of_text|>","is_local": true,"local_files_only": false,"model_max_length": 1048576,"pad_token": "<|finetune_right_pad|>",2 unmodified lines34567892 unmodified lines"bos_token": "<|begin_of_text|>","clean_up_tokenization_spaces": false,"eos_token": "<|end_of_text|>","is_local": false,"local_files_only": false,"model_max_length": 1048576,"pad_token": "<|finetune_right_pad|>",
chat_template.jinja+69-12
config.json+6-5
generation_config.json+2-2
model.safetensors+1-1
processor_config.json+3-2
tokenizer_config.json+1-1