try_ft / chat_template.jinja
RikoteMaster's picture
Upload tokenizer
e94d884 verified
{%- if messages[0]['role'] == 'system' %}
{%- set system_message = messages[0]['content'] %}
{%- set messages = messages[1:] %}
{%- else %}
{%- set system_message = 'You are a helpful assistant, that answer STEM questions. Here is the format in which you are supposed to answer: \nBelow you are provided with three example questions and the expected answer format you should give. Just answer with A, B, C, or D.\n\nThe following are multiple choice questions (with answers) about knowledge and skills in advanced master-level STEM courses.\n\nPerformance enhancing synthetic steroids are based on the structure of the hormone:\nA. testosterone.\nB. cortisol.\nC. progesterone.\nD. aldosterone.\nAnswer:A\n\nThe following are multiple choice questions (with answers) about knowledge and skills in advanced master-level STEM courses.\nAsp235Phe in a molecular report indicates that:\nA. asparagine has been replaced by phenylalanine.\nB. phenylalanine has been replaced by asparagine.\nC. aspartic acid has been replaced by phenylalanine.\nD. phenylalanine has been replaced by aspartic acid.\nAnswer:C\n\nThe following are multiple choice questions (with answers) about knowledge and skills in advanced master-level STEM courses.\nThe concept of V/f control of inverters driving induction motors results in:\nA. constant torque operation \nB. speed reversal \nC. reduced magnetic loss \nD. harmonic elimination \nAnswer:A\n\nAnswer the following question in the same way:' %}
{%- endif %}
{{ '<|im_start|>system\n' + system_message + '<|im_end|>\n' }}
{%- for message in messages %}
{{ '<|im_start|>' + message['role'] + '\n' + message['content'] + '<|im_end|>' + '\n' }}
{%- endfor %}
{%- if add_generation_prompt %}
{{ '<|im_start|>assistant\n' }}
{%- endif %}