Upload complete model
Browse files- chat_template.jinja +9 -12
chat_template.jinja
CHANGED
|
@@ -1,22 +1,19 @@
|
|
| 1 |
{%- if tools -%}
|
| 2 |
-
<|im_system|>tool_declare<|im_middle|>
|
| 3 |
-
# Tools
|
| 4 |
-
{{ tools | tojson }}<|im_end|>
|
| 5 |
{%- endif -%}
|
| 6 |
{%- for message in messages -%}
|
| 7 |
{%- if loop.first and messages[0]['role'] != 'system' -%}
|
| 8 |
<|im_system|>system<|im_middle|>You are Kimi, an AI assistant created by Moonshot AI.<|im_end|>
|
| 9 |
{%- endif -%}
|
| 10 |
-
|
| 11 |
-
|
| 12 |
-
{%-
|
| 13 |
-
<|im_user|>
|
| 14 |
{%- elif message['role'] == 'assistant' -%}
|
| 15 |
-
<|im_assistant|>
|
| 16 |
-
{%-
|
| 17 |
-
<|im_system|>
|
| 18 |
-
{
|
| 19 |
-
|
| 20 |
{%- if message['role'] == 'assistant' and message.get('tool_calls') -%}
|
| 21 |
{%- if message['content'] -%}{{ message['content'] }}{%- endif -%}
|
| 22 |
<|tool_calls_section_begin|>
|
|
|
|
| 1 |
{%- if tools -%}
|
| 2 |
+
<|im_system|>tool_declare<|im_middle|>{{ tools | tojson }}<|im_end|>
|
|
|
|
|
|
|
| 3 |
{%- endif -%}
|
| 4 |
{%- for message in messages -%}
|
| 5 |
{%- if loop.first and messages[0]['role'] != 'system' -%}
|
| 6 |
<|im_system|>system<|im_middle|>You are Kimi, an AI assistant created by Moonshot AI.<|im_end|>
|
| 7 |
{%- endif -%}
|
| 8 |
+
{%- if message['role'] == 'system' -%}
|
| 9 |
+
<|im_system|>system<|im_middle|>
|
| 10 |
+
{%- elif message['role'] == 'user' -%}
|
| 11 |
+
<|im_user|>user<|im_middle|>
|
| 12 |
{%- elif message['role'] == 'assistant' -%}
|
| 13 |
+
<|im_assistant|>assistant<|im_middle|>
|
| 14 |
+
{%- elif message['role'] == 'tool' -%}
|
| 15 |
+
<|im_system|>tool<|im_middle|>
|
| 16 |
+
{%- endif -%}
|
|
|
|
| 17 |
{%- if message['role'] == 'assistant' and message.get('tool_calls') -%}
|
| 18 |
{%- if message['content'] -%}{{ message['content'] }}{%- endif -%}
|
| 19 |
<|tool_calls_section_begin|>
|