Download chat_template.jinja from picur/picur-tokenizer: direct link, hf CLI and curl.
- Browser
- Download file 2.04 kB
-
https://huggingface.co/picur/picur-tokenizer/resolve/main/chat_template.jinja
- Command line
-
hf download hf://picur/picur-tokenizer/chat_template.jinja
-
curl -L -o chat_template.jinja https://huggingface.co/picur/picur-tokenizer/resolve/main/chat_template.jinja
2.04 kB
| {{- bos_token -}} | |
| {%- if messages[0].role == 'system' -%} | |
| {%- set system_message = messages[0].content -%} | |
| {%- set messages = messages[1:] -%} | |
| {%- else -%} | |
| {%- set system_message = '' -%} | |
| {%- endif -%} | |
| {{- '<|im_start|>system\n' + system_message -}} | |
| {%- if tools -%} | |
| {{- '\n\n# Eszközök\n\nA felhasználói kérés megválaszolásához függvényeket hívhatsz. Az elérhető függvények szignatúrái <tools></tools> XML címkék között:\n<tools>' -}} | |
| {%- for tool in tools -%} | |
| {%- set fn = tool.function if tool.function is defined else tool -%} | |
| {{- '\n' + (fn | tojson(ensure_ascii=False)) -}} | |
| {%- endfor -%} | |
| {{- '\n</tools>\n\nFüggvényhíváskor adj vissza egy json objektumot a függvény nevével és argumentumaival <tool_call></tool_call> XML címkék között:\n<tool_call>\n{"name": <függvény-név>, "arguments": <argumentum-json>}\n</tool_call>' -}} | |
| {%- endif -%} | |
| {{- '<|im_end|>\n' -}} | |
| {%- for message in messages -%} | |
| {%- if message.role == 'user' -%} | |
| {{- '<|im_start|>user\n' + message.content + '<|im_end|>\n' -}} | |
| {%- elif message.role == 'assistant' -%} | |
| {{- '<|im_start|>assistant\n' -}} | |
| {%- generation -%} | |
| {{- message.content or '' -}} | |
| {%- if message.tool_calls -%} | |
| {%- for tc in message.tool_calls -%} | |
| {%- set fn = tc.function -%} | |
| {{- '\n<tool_call>\n{"name": "' + fn.name + '", "arguments": ' -}} | |
| {%- if fn.arguments is string -%}{{- fn.arguments -}}{%- else -%}{{- fn.arguments | tojson(ensure_ascii=False) -}}{%- endif -%} | |
| {{- '}\n</tool_call>' -}} | |
| {%- endfor -%} | |
| {%- endif -%} | |
| {{- '<|im_end|>' -}} | |
| {%- endgeneration -%} | |
| {{- '\n' -}} | |
| {%- elif message.role == 'tool' -%} | |
| {{- '<|im_start|>user\n<tool_response>\n' + message.content + '\n</tool_response><|im_end|>\n' -}} | |
| {%- endif -%} | |
| {%- endfor -%} | |
| {%- if add_generation_prompt -%} | |
| {{- '<|im_start|>assistant\n' -}} | |
| {%- endif -%} | |