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