nsjain's picture
Initial commit
d52bdbe verified
{% for message in messages %}{% if message['role'] == 'user' %}{{ '<|start_header_id|>user<|end_header_id|>
' + message['content'] + '<|eot_id|>' }}{% elif message['role'] == 'system' %}{{ '<|begin_of_text|><|start_header_id|>system<|end_header_id|>
' + message['content'] + '<|eot_id|>' }}{% elif message['role'] == 'assistant' %}{{ '<|start_header_id|>assistant<|end_header_id|>
' + message['content'] + '<|eot_id|>' }}{% endif %}{% if loop.last and add_generation_prompt %}{{ '<|start_header_id|>assistant<|end_header_id|>
' }}{% endif %}{% endfor %}