inferencerlabs commited on
Commit
54dc42c
·
verified ·
1 Parent(s): 2742dbe

Upload complete model

Browse files
Files changed (1) hide show
  1. 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
- {%- set role_name = message.get('name') or message['role'] -%}
12
- {%- if message['role'] == 'user' -%}
13
- <|im_user|>{{role_name}}<|im_middle|>
14
  {%- elif message['role'] == 'assistant' -%}
15
- <|im_assistant|>{{role_name}}<|im_middle|>
16
- {%- else -%}
17
- <|im_system|>{{role_name}}<|im_middle|>
18
- {% endif %}
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|>