mirror of
https://github.com/ggerganov/llama.cpp.git
synced 2025-01-13 12:10:18 +00:00
8 lines
407 B
Django/Jinja
8 lines
407 B
Django/Jinja
{% for message in messages %}{% if message['role'] == 'system' %}{{'<|system|>
|
|
' + message['content'] + '<|end|>
|
|
'}}{% elif message['role'] == 'user' %}{{'<|user|>
|
|
' + message['content'] + '<|end|>
|
|
'}}{% elif message['role'] == 'assistant' %}{{'<|assistant|>
|
|
' + message['content'] + '<|end|>
|
|
'}}{% endif %}{% endfor %}{% if add_generation_prompt %}{{ '<|assistant|>
|
|
' }}{% else %}{{ eos_token }}{% endif %} |