chat-template-generation / templates /vicuna_v1.1.jinja2
tjtanaa's picture
init streamlit chat-template ui
7a664fd
raw
history blame
489 Bytes
{% if not add_generation_prompt is defined %}
{% set add_generation_prompt = false %}
{% endif %}
{% for message in messages %}
{% if not loop.first %}
{% endif %}
{% if message['role'] == 'system' %}
{{ message['content'] + ' ' }}
{% elif message['role'] == 'user' %}
{{ 'USER: ' + message['content'] + ' ' }}
{% elif message['role'] == 'assistant' %}
{{ 'ASSISTANT: ' + message['content'] + '</s>' }}
{% endif %}
{% endfor %}
{% if add_generation_prompt %}
{{ 'ASSISTANT:' }}
{% endif %}