File size: 431 Bytes
7a664fd
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
{% if not add_generation_prompt is defined %}
{% set add_generation_prompt = false %}
{% endif %}
{% for message in messages %}
{% if message['role'] == 'user' %}
{{ '<s>' + '[INST] ' + message['content'] + ' [/INST]' }}
{% elif message['role'] == 'system' %}
{{ '<<SYS>>\n' + message['content'] + '\n<</SYS>>\n\n' }}
{% elif message['role'] == 'assistant' %}
{{ ' '  + message['content'] + ' ' + '</s>' }}
{% endif %}
{% endfor %}