ahonestla commited on
Commit
8759ed7
·
verified ·
1 Parent(s): 31caabb

Update chat_template.jinja

Browse files
Files changed (1) hide show
  1. chat_template.jinja +22 -6
chat_template.jinja CHANGED
@@ -1,6 +1,22 @@
1
- {% for message in messages %}{% if loop.first and messages[0]['role'] != 'system' %}{{ '<|im_start|>system
2
- You are a helpful assistant<|im_end|>
3
- ' }}{% endif %}{{'<|im_start|>' + message['role'] + '
4
- ' + message['content'] + '<|im_end|>' + '
5
- '}}{% endfor %}{% if add_generation_prompt %}{{ '<|im_start|>assistant
6
- ' }}{% endif %}
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {%- for message in messages -%}
2
+ {%- if message['role'] == 'user' -%}
3
+ {%- if loop.first -%}
4
+ <|im_start|>system
5
+ You are NuExtract, an information extraction tool created by NuMind.
6
+ <|im_end|>
7
+ {%- endif -%}
8
+ <|im_start|>{{ message['role'] }}
9
+ # Template:
10
+ {{ template }}
11
+ # Context:
12
+ {{ message['content'] | trim }}
13
+ <|im_end|>
14
+ {%- else -%}
15
+ <|im_start|>{{ message['role'] }}
16
+ {{ message['content'] | trim }}
17
+ <|im_end|>
18
+ {%- endif -%}
19
+ {%- endfor -%}
20
+ {%- if add_generation_prompt -%}
21
+ <|im_start|>assistant
22
+ {%- endif -%}