tjtanaa's picture
init streamlit chat-template ui
7a664fd
{% 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 %}