Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
OpenDAS
vllm_cscc
Commits
cf6ff182
Unverified
Commit
cf6ff182
authored
Mar 16, 2024
by
Dinghow Yang
Committed by
GitHub
Mar 15, 2024
Browse files
Fix Baichuan chat template (#3340)
parent
14e3f9a1
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
19 deletions
+10
-19
examples/template_baichuan.jinja
examples/template_baichuan.jinja
+10
-19
No files found.
examples/template_baichuan.jinja
View file @
cf6ff182
{{ (messages|selectattr('role', 'equalto', 'system')|list|last).content|trim if (messages|selectattr('role', 'equalto', 'system')|list) else '' }}
{{ (messages|selectattr('role', 'equalto', 'system')|list|last).content|trim if (messages|selectattr('role', 'equalto', 'system')|list) else '' }}
{% for message in messages %}
{%- for message in messages -%}
{% if message['role'] == 'user' %}
{%- if message['role'] == 'user' -%}
<reserved_106>
{{- '<reserved_106>' + message['content'] -}}
{{ message['content']|trim -}}
{%- elif message['role'] == 'assistant' -%}
{% if not loop.last %}
{{- '<reserved_107>' + message['content'] -}}
{%- endif -%}
{%- endfor -%}
{% endif %}
{% elif message['role'] == 'assistant' %}
{%- if add_generation_prompt and messages[-1]['role'] != 'assistant' -%}
<reserved_107>
{{- '<reserved_107>' -}}
{{ message['content']|trim -}}
{% if not loop.last %}
{% endif %}
{% endif %}
{% endfor %}
{% if add_generation_prompt and messages[-1]['role'] != 'assistant' %}
<reserved_107>
{% endif %}
{% endif %}
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment