mirror of
https://github.com/ggerganov/llama.cpp.git
synced 2025-01-13 12:10:18 +00:00
1 line
445 B
Django/Jinja
1 line
445 B
Django/Jinja
{% if not add_generation_prompt is defined %}{% set add_generation_prompt = false %}{% endif %}{{ bos_token }}{% for message in messages %}{% if message['role'] == 'user' %}{{ ' Question: ' + message['content']}}{% elif message['role'] == 'assistant' %}{{ ' Answer: ' + message['content'] + eos_token }}{% elif message['role'] == 'system' %}{{ message['content']}}{% endif %}{% endfor %}{% if add_generation_prompt %}{{ ' Answer: ' }}{% endif %} |