chat_template存在兼容性问题

#31
by bangbangkido - opened

问题定位:
{%- for message in messages %}
{%- set content = render_content(message.content, true)|trim %}
{%- if message.role == "system" %}
{%- if not loop.first %} {{- raise_exception('System message must be at the beginning.') }} {%- endif %}
{%- endif %}
{# ... 后续处理其他角色 ... #}
{%- endfor %}

Claude Code会在 content 中间穿插 system 消息, 模版中这段规则会直接报错.
本模型继承了qwen官方的聊天模版? 目前有MIT协议的社区方案在优化Qwen官方的聊天模版, 见https://huggingface.co/froggeric/Qwen-Fixed-Chat-Templates
😀

Sign up or log in to comment