Jinja templates for Instruct and Chat (#4874)
This commit is contained in:
parent
aab0dd962d
commit
39d2fe1ed9
71 changed files with 1774 additions and 518 deletions
|
@ -1,5 +1,25 @@
|
|||
user: "### Human:"
|
||||
bot: "### Assistant:"
|
||||
turn_template: "<|user|> <|user-message|>\n<|bot|> <|bot-message|>\n"
|
||||
context: "<|system-message|>\n\n"
|
||||
system_message: "A chat between a curious human and an artificial intelligence assistant. The assistant gives helpful, detailed, and polite answers to the human's questions."
|
||||
instruction_template: |-
|
||||
{%- set found_item = false -%}
|
||||
{%- for message in messages -%}
|
||||
{%- if message['role'] == 'system' -%}
|
||||
{%- set found_item = true -%}
|
||||
{%- endif -%}
|
||||
{%- endfor -%}
|
||||
{%- if not found_item -%}
|
||||
{{- '' + 'A chat between a curious human and an artificial intelligence assistant. The assistant gives helpful, detailed, and polite answers to the human's questions.' + '\n\n' -}}
|
||||
{%- endif %}
|
||||
{%- for message in messages %}
|
||||
{%- if message['role'] == 'system' -%}
|
||||
{{- '' + message['content'] + '\n\n' -}}
|
||||
{%- else -%}
|
||||
{%- if message['role'] == 'user' -%}
|
||||
{{-'### Human: ' + message['content'] + '\n'-}}
|
||||
{%- else -%}
|
||||
{{-'### Assistant: ' + message['content'] + '\n' -}}
|
||||
{%- endif -%}
|
||||
{%- endif -%}
|
||||
{%- endfor -%}
|
||||
{%- if add_generation_prompt -%}
|
||||
{{-'### Assistant:'-}}
|
||||
{%- endif -%}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue