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: ""
|
||||
bot: ""
|
||||
turn_template: "[INST] <|user|><|user-message|> [/INST]<|bot|><|bot-message|></s> "
|
||||
context: ""
|
||||
system_message: ""
|
||||
instruction_template: |-
|
||||
{%- set found_item = false -%}
|
||||
{%- for message in messages -%}
|
||||
{%- if message['role'] == 'system' -%}
|
||||
{%- set found_item = true -%}
|
||||
{%- endif -%}
|
||||
{%- endfor -%}
|
||||
{%- if not found_item -%}
|
||||
{{- '' + '' + '' -}}
|
||||
{%- endif %}
|
||||
{%- for message in messages %}
|
||||
{%- if message['role'] == 'system' -%}
|
||||
{{- '' + message['content'] + '' -}}
|
||||
{%- else -%}
|
||||
{%- if message['role'] == 'user' -%}
|
||||
{{-'[INST] ' + message['content'] + ' [/INST]'-}}
|
||||
{%- else -%}
|
||||
{{-'' + message['content'] + '</s> ' -}}
|
||||
{%- endif -%}
|
||||
{%- endif -%}
|
||||
{%- endfor -%}
|
||||
{%- if add_generation_prompt -%}
|
||||
{{-''-}}
|
||||
{%- endif -%}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue