Llama3_8B_Ollama / chat_template.jinja
Sandhya2002's picture
Upload model trained with Unsloth
b1897e8 verified
{{ bos_token }}{% if messages[0]['role'] == 'system' %}{{ '<|start_header_id|>system<|end_header_id|>
' + messages[0]['content'] + '<|eot_id|>' }}{% set loop_messages = messages[1:] %}{% else %}{{ '<|start_header_id|>system<|end_header_id|>
Below are some instructions that describe some tasks. Write responses that appropriately complete each request.<|eot_id|>' }}{% set loop_messages = messages %}{% endif %}{% for message in loop_messages %}{% if message['role'] == 'user' %}{{ '<|start_header_id|>user<|end_header_id|>
' + message['content'] }}{% elif message['role'] == 'assistant' %}{{ '<|eot_id|><|start_header_id|>assistant<|end_header_id|>
' + message['content'] + '<|eot_id|><|end_of_text|>' }}{% else %}{{ raise_exception('Only user and assistant roles are supported!') }}{% endif %}{% endfor %}{% if add_generation_prompt %}{{ '<|eot_id|><|start_header_id|>assistant<|end_header_id|>
' }}{% endif %}