Download chat_template.jinja from chankhavu/olmo_32b_fp8_niiattempt2_step6000_20260614073137: direct link, hf CLI and curl.
- Browser
- Download file 2.18 kB
-
https://huggingface.co/chankhavu/olmo_32b_fp8_niiattempt2_step6000_20260614073137/resolve/main/chat_template.jinja
- Command line
-
hf download hf://chankhavu/olmo_32b_fp8_niiattempt2_step6000_20260614073137/chat_template.jinja
-
curl -L -o chat_template.jinja https://huggingface.co/chankhavu/olmo_32b_fp8_niiattempt2_step6000_20260614073137/resolve/main/chat_template.jinja
2.18 kB
| {% set has_system = messages|selectattr('role', 'equalto', 'system')|list|length > 0 %}{% if not has_system %}{{ '<|im_start|>system | |
| You are a helpful AI assistant.<|im_end|> | |
| ' }}{% endif %}{% for message in messages %}{% if message['role'] == 'system' %}{{ '<|im_start|>system | |
| ' + message['content'] }}{% if tools is defined and tools %}{{ ' <functions>' }}{{ tools | tojson }}{{ '</functions><|im_end|> | |
| ' }}{% elif message.get('functions', none) is not none %}{{ ' <functions>' }}{{ message['functions'] }}{{ '</functions><|im_end|> | |
| ' }}{% else %}{{ ' You do not currently have access to any functions. <functions></functions><|im_end|> | |
| ' }}{% endif %}{% elif message['role'] == 'user' %}{% if message.get('functions', none) is not none %}{{ '<|im_start|>user | |
| ' + message['content'] + ' | |
| ' + '<functions>' + message['functions'] + '</functions><|im_end|> | |
| ' }}{% else %}{{ '<|im_start|>user | |
| ' + message['content'] + '<|im_end|> | |
| ' }}{% endif %}{% elif message['role'] == 'assistant' %}{{ '<|im_start|>assistant | |
| ' }}{% if message.get('content', none) is not none %}{{ message['content'] }}{% endif %}{% if message.get('function_calls', none) is not none %}{{ '<function_calls>' + message['function_calls'] + '</function_calls>' }}{% elif message.get('tool_calls', none) is not none %}{{ '<function_calls>' }}{%- for tc in message['tool_calls'] %}{%- if tc is mapping and tc.get('function', none) is not none %}{%- set a = tc['function']['arguments'] %}{%- set ns = namespace(al=[]) %}{%- for k,v in a.items() %}{%- set ns.al = ns.al + [k ~ '=' ~ (v | tojson)] %}{%- endfor %}{{- tc['function']['name'] + '(' + (ns.al | join(', ')) + ')' }}{%- if not loop.last %}{{ ' | |
| ' }}{%- endif %}{%- else %}{{ tc }}{%- endif %}{%- endfor %}{{ '</function_calls>' }}{% endif %}{% if not loop.last %}{{ '<|im_end|>' + ' | |
| ' }}{% else %}{{ eos_token }}{% endif %}{% elif message['role'] == 'environment' %}{{ '<|im_start|>environment | |
| ' + message['content'] + '<|im_end|> | |
| ' }}{% elif message['role'] == 'tool' %}{{ '<|im_start|>environment | |
| ' + message['content'] + '<|im_end|> | |
| ' }}{% endif %}{% if loop.last and add_generation_prompt %}{{ '<|im_start|>assistant | |
| <think>' }}{% endif %}{% endfor %} |