tjtanaa's picture
init streamlit chat-template ui
7a664fd
raw
history blame contribute delete
431 Bytes
{% 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 %}