Skip to content

Commit

Permalink
Update template_chatml.jinja
Browse files Browse the repository at this point in the history
  • Loading branch information
jklj077 authored Apr 30, 2024
1 parent a24b227 commit 40d1435
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions recipes/inference/vllm/template_chatml.jinja
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
{% for message in messages %}
{% if loop.first and messages[0]['role'] != 'system' %}{{ '<|im_start|>system\nYou are a helpful assistant<|im_end|>\n' }}{% endif %}
{{'<|im_start|>' + message['role'] + '\n' + message['content']}}
{% if (loop.last and add_generation_prompt) or not loop.last %}{{ '<|im_end|>' + '\n'}}{% endif %}
{% if loop.first and message['role'] != 'system' %}{{ '<|im_start|>system\nYou are a helpful assistant.<|im_end|>\n' }}{% endif %}
{{ '<|im_start|>' + message['role'] + '\n' + message['content'] + '<|im_end|>\n' }}
{% if loop.last and add_generation_prompt %}{{ '<|im_start|>assistant\n' }}{% endif %}
{% endfor %}
{% if add_generation_prompt and messages[-1]['role'] != 'assistant' %}{{ '<|im_start|>assistant\n' }}{% endif %}

0 comments on commit 40d1435

Please sign in to comment.