Upload tokenizer
Browse files- chat_template.jinja +5 -5
chat_template.jinja
CHANGED
|
@@ -8,10 +8,10 @@
|
|
| 8 |
{{- "\n" }}
|
| 9 |
{{- tool | tojson }}
|
| 10 |
{%- endfor %}
|
| 11 |
-
{{- "\n</tools>\n\nFor each function call, return a json object with function name and arguments within <tool_call></tool_call> XML tags:\n<tool_call>\n{\"name\": <function-name>, \"arguments\": <args-json-object>}\n</tool_call><|
|
| 12 |
{%- else %}
|
| 13 |
{%- if messages[0].role == 'system' %}
|
| 14 |
-
{{- '<|im_start|>system\n' + messages[0].content + '<|
|
| 15 |
{%- endif %}
|
| 16 |
{%- endif %}
|
| 17 |
{%- set ns = namespace(multi_step_tool=true, last_query_index=messages|length - 1) %}
|
|
@@ -29,7 +29,7 @@
|
|
| 29 |
{%- set content = '' %}
|
| 30 |
{%- endif %}
|
| 31 |
{%- if (message.role == "user") or (message.role == "system" and not loop.first) %}
|
| 32 |
-
{{- '<|im_start|>' + message.role + '\n' + content + '<|
|
| 33 |
{%- elif message.role == "assistant" %}
|
| 34 |
{%- set reasoning_content = '' %}
|
| 35 |
{%- if message.reasoning_content is string %}
|
|
@@ -68,7 +68,7 @@
|
|
| 68 |
{{- '}\n</tool_call>' }}
|
| 69 |
{%- endfor %}
|
| 70 |
{%- endif %}
|
| 71 |
-
{{- '<|
|
| 72 |
{%- elif message.role == "tool" %}
|
| 73 |
{%- if loop.first or (messages[loop.index0 - 1].role != "tool") %}
|
| 74 |
{{- '<|im_start|>user' }}
|
|
@@ -77,7 +77,7 @@
|
|
| 77 |
{{- content }}
|
| 78 |
{{- '\n</tool_response>' }}
|
| 79 |
{%- if loop.last or (messages[loop.index0 + 1].role != "tool") %}
|
| 80 |
-
{{- '<|
|
| 81 |
{%- endif %}
|
| 82 |
{%- endif %}
|
| 83 |
{%- endfor %}
|
|
|
|
| 8 |
{{- "\n" }}
|
| 9 |
{{- tool | tojson }}
|
| 10 |
{%- endfor %}
|
| 11 |
+
{{- "\n</tools>\n\nFor each function call, return a json object with function name and arguments within <tool_call></tool_call> XML tags:\n<tool_call>\n{\"name\": <function-name>, \"arguments\": <args-json-object>}\n</tool_call><|im_end|>\n" }}
|
| 12 |
{%- else %}
|
| 13 |
{%- if messages[0].role == 'system' %}
|
| 14 |
+
{{- '<|im_start|>system\n' + messages[0].content + '<|im_end|>\n' }}
|
| 15 |
{%- endif %}
|
| 16 |
{%- endif %}
|
| 17 |
{%- set ns = namespace(multi_step_tool=true, last_query_index=messages|length - 1) %}
|
|
|
|
| 29 |
{%- set content = '' %}
|
| 30 |
{%- endif %}
|
| 31 |
{%- if (message.role == "user") or (message.role == "system" and not loop.first) %}
|
| 32 |
+
{{- '<|im_start|>' + message.role + '\n' + content + '<|im_end|>' + '\n' }}
|
| 33 |
{%- elif message.role == "assistant" %}
|
| 34 |
{%- set reasoning_content = '' %}
|
| 35 |
{%- if message.reasoning_content is string %}
|
|
|
|
| 68 |
{{- '}\n</tool_call>' }}
|
| 69 |
{%- endfor %}
|
| 70 |
{%- endif %}
|
| 71 |
+
{{- '<|im_end|>\n' }}
|
| 72 |
{%- elif message.role == "tool" %}
|
| 73 |
{%- if loop.first or (messages[loop.index0 - 1].role != "tool") %}
|
| 74 |
{{- '<|im_start|>user' }}
|
|
|
|
| 77 |
{{- content }}
|
| 78 |
{{- '\n</tool_response>' }}
|
| 79 |
{%- if loop.last or (messages[loop.index0 + 1].role != "tool") %}
|
| 80 |
+
{{- '<|im_end|>\n' }}
|
| 81 |
{%- endif %}
|
| 82 |
{%- endif %}
|
| 83 |
{%- endfor %}
|