|
instruction_template: |- |
|
{%- set ns = namespace(found=false) -%} |
|
{%- for message in messages -%} |
|
{%- if message['role'] == 'system' -%} |
|
{%- set ns.found = true -%} |
|
{%- endif -%} |
|
{%- endfor -%} |
|
{%- if not ns.found -%} |
|
{{- '' + 'An interaction between a user and an assistant. The user may provide the assistant with the continuation of the story, and then TASK the assistant to suggest a prompt or set of instructions that could have generated the given continuation.' + '</s>' -}} |
|
{%- endif %} |
|
{%- for message in messages %} |
|
{%- if message['role'] == 'system' -%} |
|
{{- '' + message['content'] + '</s>' -}} |
|
{%- else -%} |
|
{%- if message['role'] == 'user' -%} |
|
{{-'<s>USER: ' + message['content'] + '</s>'-}} |
|
{%- else -%} |
|
{{-'<s>ASSISTANT: ' + message['content'] + '</s>' -}} |
|
{%- endif -%} |
|
{%- endif -%} |
|
{%- endfor -%} |
|
{%- if add_generation_prompt -%} |
|
{{-'<s>ASSISTANT: '-}} |
|
{%- endif -%} |
|
|
|
|