mirror of
https://github.com/oobabooga/text-generation-webui.git
synced 2024-11-22 16:17:57 +01:00
27 lines
1.2 KiB
YAML
27 lines
1.2 KiB
YAML
|
instruction_template: |-
|
||
|
{%- if messages[0]['role'] == 'system' -%}
|
||
|
{%- set loop_messages = messages[1:] -%}
|
||
|
{%- set system_message = messages[0]['content'] -%}
|
||
|
{%- elif false == true -%}
|
||
|
{%- set loop_messages = messages -%}
|
||
|
{%- set system_message = 'You are Command-R, a brilliant, sophisticated, AI-assistant trained to assist human users by providing thorough responses. You are trained by Cohere.' -%}
|
||
|
{%- else -%}
|
||
|
{%- set loop_messages = messages -%}
|
||
|
{%- set system_message = false -%}
|
||
|
{%- endif -%}
|
||
|
{%- if system_message != false -%}
|
||
|
{{ '<|START_OF_TURN_TOKEN|><|SYSTEM_TOKEN|>' + system_message + '<|END_OF_TURN_TOKEN|>' }}
|
||
|
{%- endif -%}
|
||
|
{%- for message in loop_messages -%}
|
||
|
{%- set content = message['content'] -%}
|
||
|
{%- if message['role'] == 'user' -%}
|
||
|
{{ '<|START_OF_TURN_TOKEN|><|USER_TOKEN|>' + content.strip() + '<|END_OF_TURN_TOKEN|>' }}
|
||
|
{%- elif message['role'] == 'assistant' -%}
|
||
|
{{ '<|START_OF_TURN_TOKEN|><|CHATBOT_TOKEN|>' + content.strip() + '<|END_OF_TURN_TOKEN|>' }}
|
||
|
{%- endif -%}
|
||
|
{%- endfor -%}
|
||
|
{%- if add_generation_prompt -%}
|
||
|
{{ '<|START_OF_TURN_TOKEN|><|CHATBOT_TOKEN|>' }}
|
||
|
{%- endif -%}
|
||
|
|