diff --git a/instruction-templates/NVIDIA-ChatQA.yaml b/instruction-templates/NVIDIA-ChatQA.yaml new file mode 100644 index 00000000..85a6266b --- /dev/null +++ b/instruction-templates/NVIDIA-ChatQA.yaml @@ -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 -%} + diff --git a/models/config.yaml b/models/config.yaml index dcbce9e7..8521c4c6 100644 --- a/models/config.yaml +++ b/models/config.yaml @@ -204,3 +204,5 @@ instruction_template: 'ChatML' .*airoboros-3_1-yi-34b-200k: instruction_template: 'Llama-v2' +.*chatqa: + instruction_template: 'NVIDIA-ChatQA'