Skip to content

Commit

Permalink
Add baichuan chat template jinjia file (vllm-project#2390)
Browse files Browse the repository at this point in the history
  • Loading branch information
taaaaaake authored Jan 9, 2024
1 parent 28c3f12 commit 74cd5ab
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions examples/template_baichuan.jinja
Original file line number Diff line number Diff line change
@@ -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' %}
<reserved_106>
{{ message['content']|trim -}}
{% if not loop.last %}


{% endif %}
{% elif message['role'] == 'assistant' %}
<reserved_107>
{{ message['content']|trim -}}
{% if not loop.last %}


{% endif %}
{% endif %}
{% endfor %}
{% if add_generation_prompt and messages[-1]['role'] != 'assistant' %}
<reserved_107>
{% endif %}

0 comments on commit 74cd5ab

Please sign in to comment.