mirror of
https://github.com/oobabooga/text-generation-webui.git
synced 2024-11-25 09:19:23 +01:00
Improve ChatML template (#5411)
This commit is contained in:
parent
2a45620c85
commit
9fdee65cf5
@ -5,15 +5,12 @@ instruction_template: |-
|
||||
{%- set ns.found = true -%}
|
||||
{%- endif -%}
|
||||
{%- endfor -%}
|
||||
{%- if not ns.found -%}
|
||||
{{- '<|im_start|>system\n' + '' + '<|im_end|>\n' -}}
|
||||
{%- endif %}
|
||||
{%- for message in messages %}
|
||||
{%- if message['role'] == 'system' -%}
|
||||
{{- '<|im_start|>system\n' + message['content'] + '<|im_end|>\n' -}}
|
||||
{{- '<|im_start|>system\n' + message['content'].rstrip() + '<|im_end|>\n' -}}
|
||||
{%- else -%}
|
||||
{%- if message['role'] == 'user' -%}
|
||||
{{-'<|im_start|>user\n' + message['content'] + '<|im_end|>\n'-}}
|
||||
{{-'<|im_start|>user\n' + message['content'].rstrip() + '<|im_end|>\n'-}}
|
||||
{%- else -%}
|
||||
{{-'<|im_start|>assistant\n' + message['content'] + '<|im_end|>\n' -}}
|
||||
{%- endif -%}
|
||||
|
Loading…
Reference in New Issue
Block a user