File size: 517 Bytes
7a664fd
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
{% if not add_generation_prompt is defined %}
{% set add_generation_prompt = false %}
{% endif %}
{% for message in messages %}
{% if message['role'] == 'user' %}
{{ 'User: ' + message['content'] + '<|end_of_turn|>' + '\n' }}
{% elif message['role'] == 'system' %}
{{ message['content'] + '<|end_of_turn|>'  + '\n' }}
{% elif message['role'] == 'assistant' %}
{{ 'Assistant: '  + message['content'] + '<|end_of_turn|>'  + '\n' }}
{% endif %}
{% endfor %}
{% if add_generation_prompt %}
{{ 'Assistant: ' }}
{% endif %}