Run this model with HF Jobs

Run VisualInference/Molmo3-4B-MLX-8bit 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 to fine-tune https://huggingface.co/VisualInference/Molmo3-4B-MLX-8bit. 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/VisualInference/Molmo3-4B-MLX-8bit 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/VisualInference/Molmo3-4B-MLX-8bit. 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.
Molmo3-4B-MLX-8bit / chat_template.jinja
VisualInference's picture
Upload MLX build
d794c70 verified
Raw History Blame Contribute Delete
2.92 kB
{#- Count the images of the conversation. If there are more than one, each is prefixed with "Image <n>" -#}
{%- set counts = namespace(images=0, image=0) -%}
{%- for message in messages -%}
{%- if message['content'] is not string -%}
{%- for item in message['content'] -%}
{%- if item['type'] == 'image' -%}
{%- set counts.images = counts.images + 1 -%}
{%- endif -%}
{%- endfor -%}
{%- endif -%}
{%- endfor -%}
{%- for message in messages -%}
{%- if (message['role'] == 'user') != (loop.index0 % 2 == 0) or message['role'] not in ['user', 'assistant'] -%}
{{- raise_exception('Conversation roles must alternate user/assistant/user/assistant/...') -}}
{%- endif -%}
{%- set text = namespace(value='') -%}
{%- if message['content'] is string -%}
{%- set text.value = message['content'] -%}
{%- else -%}
{%- for item in message['content'] -%}
{%- if item['type'] == 'image' -%}
{%- set counts.image = counts.image + 1 -%}
{%- if counts.images > 1 -%}
{%- set text.value = text.value + 'Image ' + counts.image|string -%}
{%- endif -%}
{%- set text.value = text.value + '<|image|>' -%}
{%- elif item['type'] == 'video' -%}
{%- set text.value = text.value + '<|video|>' -%}
{%- elif item['type'] == 'text' -%}
{%- if item['style'] is defined and item['style'] -%}
{%- set text.value = text.value + item['style'] + ': ' + item['text'] -%}
{%- else -%}
{%- set text.value = text.value + item['text'] -%}
{%- endif -%}
{%- elif item['type'] == 'points' -%}
{%- set coords = namespace(value='') -%}
{%- for coordinate in item['coordinates'] -%}
{%- set coords.value = coords.value + '<|POINT_PATCH|><|POINT_SUBPATCH|><|POINT_LOC|>' + loop.index|string -%}
{%- endfor -%}
{%- set tag = '<points coords="' + coords.value + '<|POINT_PATCH|>"' -%}
{%- if item['label'] is defined and item['label'] -%}
{%- set text.value = text.value + tag + '>' + item['label'] + '</points>' -%}
{%- else -%}
{%- set text.value = text.value + tag + '/>' -%}
{%- endif -%}
{%- endif -%}
{%- endfor -%}
{%- endif -%}
{%- if message['role'] == 'user' -%}
{%- if not loop.first -%}
{{- '<|im_end|>\n' -}}
{%- endif -%}
{{- '<|im_start|>user\n' + text.value + '<|im_end|>\n' -}}
{%- else -%}
{{- '<|im_start|>assistant\n' + text.value -}}
{%- endif -%}
{%- endfor -%}
{%- if add_generation_prompt -%}
{{- '<|im_start|>assistant\n' -}}
{%- endif -%}