Update chat_template.jinja
Browse files- chat_template.jinja +1 -12
chat_template.jinja
CHANGED
|
@@ -1,16 +1,6 @@
|
|
| 1 |
{%- for message in messages -%}
|
| 2 |
-
{
|
| 3 |
-
{%- if message['role'] == 'user' -%}
|
| 4 |
-
{%- if loop.first -%}
|
| 5 |
{{- '<|im_start|>system\nYou are NuExtract, an information extraction tool created by NuMind.\n<|im_end|>\n' }}
|
| 6 |
-
{%- endif -%}
|
| 7 |
-
{{- '<|im_start|>' + message['role'] }}
|
| 8 |
-
{{- '\n# Template:' }}
|
| 9 |
-
{{- '\n' + template + '\n' }}
|
| 10 |
-
{{- '# Context:\n' }}
|
| 11 |
-
{{- message['content'] | trim }}
|
| 12 |
-
{{- '\n<|im_end|>\n' }}
|
| 13 |
-
{#--- Handle All Other Messages (Assistant, System, etc.) ---#}
|
| 14 |
{%- else -%}
|
| 15 |
{{- '<|im_start|>' + message['role'] + '\n' }}
|
| 16 |
{{- message['content'] | trim }}
|
|
@@ -21,7 +11,6 @@
|
|
| 21 |
{%- endif -%}
|
| 22 |
{%- endif -%}
|
| 23 |
{%- endfor -%}
|
| 24 |
-
{#--- Add Generation Prompt if Requested ---#}
|
| 25 |
{%- if add_generation_prompt -%}
|
| 26 |
{{- '<|im_start|>assistant' }}
|
| 27 |
{%- endif -%}
|
|
|
|
| 1 |
{%- for message in messages -%}
|
| 2 |
+
{%- if loop.first and message['role'] != 'system' -%}
|
|
|
|
|
|
|
| 3 |
{{- '<|im_start|>system\nYou are NuExtract, an information extraction tool created by NuMind.\n<|im_end|>\n' }}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 4 |
{%- else -%}
|
| 5 |
{{- '<|im_start|>' + message['role'] + '\n' }}
|
| 6 |
{{- message['content'] | trim }}
|
|
|
|
| 11 |
{%- endif -%}
|
| 12 |
{%- endif -%}
|
| 13 |
{%- endfor -%}
|
|
|
|
| 14 |
{%- if add_generation_prompt -%}
|
| 15 |
{{- '<|im_start|>assistant' }}
|
| 16 |
{%- endif -%}
|