Add a template for NVIDIA ChatQA models

This commit is contained in:
oobabooga 2024-05-03 08:19:04 -07:00
parent e9c9483171
commit cb31998605
2 changed files with 27 additions and 0 deletions

View File

@ -0,0 +1,25 @@
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 -%}
{{- '' -}}
{%- endif %}
{%- for message in messages %}
{%- if message['role'] == 'system' -%}
{{- 'System:' + message['content'] + '\n\n' -}}
{%- else -%}
{%- if message['role'] == 'user' -%}
{{-'User: ' + message['content'] + '\n\n'-}}
{%- else -%}
{{-'Assistant: ' + message['content'] + '\n\n' -}}
{%- endif -%}
{%- endif -%}
{%- endfor -%}
{%- if add_generation_prompt -%}
{{-'Assistant:'-}}
{%- endif -%}

View File

@ -204,3 +204,5 @@
instruction_template: 'ChatML' instruction_template: 'ChatML'
.*airoboros-3_1-yi-34b-200k: .*airoboros-3_1-yi-34b-200k:
instruction_template: 'Llama-v2' instruction_template: 'Llama-v2'
.*chatqa:
instruction_template: 'NVIDIA-ChatQA'