diff --git a/examples/template_baichuan.jinja b/examples/template_baichuan.jinja new file mode 100644 index 0000000000000..a1812a6c09ab1 --- /dev/null +++ b/examples/template_baichuan.jinja @@ -0,0 +1,22 @@ +{{ (messages|selectattr('role', 'equalto', 'system')|list|last).content|trim if (messages|selectattr('role', 'equalto', 'system')|list) else '' }} + +{% for message in messages %} +{% if message['role'] == 'user' %} + +{{ message['content']|trim -}} +{% if not loop.last %} + + +{% endif %} +{% elif message['role'] == 'assistant' %} + +{{ message['content']|trim -}} +{% if not loop.last %} + + +{% endif %} +{% endif %} +{% endfor %} +{% if add_generation_prompt and messages[-1]['role'] != 'assistant' %} + +{% endif %} \ No newline at end of file