McG-221 commited on
Commit
1848ae6
·
verified ·
1 Parent(s): 0edc2e3

Upload chat_template.jinja with huggingface_hub

Browse files
Files changed (1) hide show
  1. chat_template.jinja +1 -0
chat_template.jinja ADDED
@@ -0,0 +1 @@
 
 
1
+ {% if 'role' in messages[0] %}{{- bos_token }}{% for message in messages %}{% if message['role'] == 'system' %}{{ '<|START_OF_TURN_TOKEN|><|SYSTEM_TOKEN|>' + message['content'] | trim + '<|END_OF_TURN_TOKEN|>' }}{% elif message['role'] == 'user' %}{{ '<|START_OF_TURN_TOKEN|><|USER_TOKEN|>' + message['content'] | trim + '<|END_OF_TURN_TOKEN|>' }}{% elif message['role'] == 'assistant' %}{{ '<|START_OF_TURN_TOKEN|><|CHATBOT_TOKEN|><|START_RESPONSE|>' + message['content'] | trim + '<|END_RESPONSE|><|END_OF_TURN_TOKEN|>' }}{% endif %}{% endfor %}{% if add_generation_prompt %}{{ '<|START_OF_TURN_TOKEN|><|CHATBOT_TOKEN|><|START_RESPONSE|>' }}{% endif %}{% else %}{{- bos_token }}{% for message in messages %}{% if message['from'] == 'system' %}{{ '<|START_OF_TURN_TOKEN|><|SYSTEM_TOKEN|>' + message['value'] | trim + '<|END_OF_TURN_TOKEN|>' }}{% elif message['from'] == 'human' %}{{ '<|START_OF_TURN_TOKEN|><|USER_TOKEN|>' + message['value'] | trim + '<|END_OF_TURN_TOKEN|>' }}{% elif message['from'] == 'gpt' %}{{ '<|START_OF_TURN_TOKEN|><|CHATBOT_TOKEN|><|START_RESPONSE|>' + message['value'] | trim + '<|END_RESPONSE|><|END_OF_TURN_TOKEN|>' }}{% endif %}{% endfor %}{% if add_generation_prompt %}{{ '<|START_OF_TURN_TOKEN|><|CHATBOT_TOKEN|><|START_RESPONSE|>' }}{% endif %}{% endif %}