"tests/vscode:/vscode.git/clone" did not exist on "57329a8c013ca9e5d575faad3f04436f2eabad15"
Unverified Commit d75ab55f authored by Isotr0py's avatar Isotr0py Committed by GitHub
Browse files

[Misc] Add deepseek_vl2 chat template (#12143)


Signed-off-by: default avatarIsotr0py <2037008807@qq.com>
parent d1adb9b4
{%- if messages[0]['role'] == 'system' -%}
{%- set system_message = messages[0]['content'] -%}
{%- set messages = messages[1:] -%}
{%- else -%}
{% set system_message = '' -%}
{%- endif -%}
{{ bos_token + system_message }}
{%- for message in messages -%}
{%- if (message['role'] == 'user') != (loop.index0 % 2 == 0) -%}
{{ raise_exception('Conversation roles must alternate user/assistant/user/assistant/...') }}
{%- endif -%}
{%- if message['role'] == 'user' -%}
{{ '<|User|>: ' + message['content'] + '\n' }}
{%- elif message['role'] == 'assistant' -%}
{{ '<|Assistant|>: ' + message['content'] + eos_token + '\n' }}
{%- endif -%}
{%- endfor -%}
{%- if add_generation_prompt -%}
{{ '<|Assistant|>: ' }}
{% endif %}
...@@ -754,6 +754,7 @@ def test_resolve_content_format_hf_defined(model, expected_format): ...@@ -754,6 +754,7 @@ def test_resolve_content_format_hf_defined(model, expected_format):
("template_chatglm.jinja", "string"), ("template_chatglm.jinja", "string"),
("template_chatglm2.jinja", "string"), ("template_chatglm2.jinja", "string"),
("template_chatml.jinja", "string"), ("template_chatml.jinja", "string"),
("template_deepseek_vl2.jinja", "string"),
("template_falcon_180b.jinja", "string"), ("template_falcon_180b.jinja", "string"),
("template_falcon.jinja", "string"), ("template_falcon.jinja", "string"),
("template_inkbot.jinja", "string"), ("template_inkbot.jinja", "string"),
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment