Repository navigation
fix(llm): restore the official Qwen2.5-Coder chat template - #5894
Conversation
qwen2.5-coder-instruct and XiYanSQL-QwenCoder-2504 both advertise the
tools ability, but their chat_template is the first upload of
Qwen/Qwen2.5-Coder-7B-Instruct (6ab006b, 2024-09-17). In that version the
tool-call example sits inside a Jinja string literal as
{{"name": ..., "arguments": ...}}, so the tools prompt showed the model
a literal double-braced example instead of the JSON object it was
trained to emit. Qwen fixed this on 2024-09-19 (0b044f5); the day before
(8d20e2b) the default system prompt also became "You are Qwen, created
by Alibaba Cloud. You are a helpful assistant."
Restore both entries to the current official template. It is the same
in every Qwen2.5-Coder-*-Instruct size and in
XGenerationLab/XiYanSQL-QwenCoder-{7B,32B}-2504:
https://huggingface.co/Qwen/Qwen2.5-Coder-7B-Instruct/blob/c03e6d358207e414f1eca0bb1891e29f1db0e242/tokenizer_config.json
https://huggingface.co/XGenerationLab/XiYanSQL-QwenCoder-7B-2504/blob/afe320fcaf18bee342174b4e35e5a481ae93719f/tokenizer_config.json
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
qinxuye
left a comment
There was a problem hiding this comment.
LGTM. Both catalog templates match the official Qwen2.5-Coder and XiYanSQL templates. The tool-call example now uses single braces, and the default system prompt matches upstream; explicit system messages remain unchanged. Other catalog fields are unchanged.
Validation: 255 related tests, 40 rendering checks, 24 adapter prompt-preparation checks, and pre-commit passed. Both new regression cases fail with the base templates. Regenerating documentation leaves the affected model pages unchanged. Model inference was not run locally.
The remaining Windows Python 3.14 CI failure is in test_abort_rpc_failure_restores_admission_and_allows_new_handoff, reporting HandoffPending: Cannot confirm preparation rollback. It is unrelated to these template changes. No unresolved review threads.
Description
qwen2.5-coder-instructandXiYanSQL-QwenCoder-2504both advertise thetoolsability. Theirchat_templateis the first upload of Qwen/Qwen2.5-Coder-7B-Instruct (6ab006b, 2024-09-17). In that version the tool-call example sits inside a Jinja string literal, so the tools prompt shows the model a literal double-braced example rather than the JSON object it is expected to emit:<tool_call>\n{{"name": <function-name>, "arguments": <args-json-object>}}\n</tool_call><tool_call>\n{"name": <function-name>, "arguments": <args-json-object>}\n</tool_call>Qwen fixed this upstream on 2024-09-19 (0b044f5). This PR replaces only the
chat_templateof both entries with the current official template. That template is the same in every Qwen2.5-Coder-*-Instruct size and in XGenerationLab/XiYanSQL-QwenCoder-{7B,32B}-2504:Behavior change to note: the official template also changed the default system prompt, the day before (8d20e2b). When the request has no system message, the prompt now starts with
You are Qwen, created by Alibaba Cloud. You are a helpful assistant.instead ofYou are a helpful assistant.This is whattransformers'apply_chat_templateproduces for these models.Test
The new
xinference/model/llm/tests/test_qwen25_coder_chat_template.pyrenders a tools prompt for both models and checks that the call example is single-braced. It fails onmainand passes with this change.pre-commit runon the changed files passes, including the catalog schema check.🤖 Generated with Claude Code