Move chat templates from inline strings to .jinja files#5459
Move chat templates from inline strings to .jinja files#5459qgallouedec merged 18 commits intomainfrom
.jinja files#5459Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 08d4c518ec
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update. |
…sages + async grpo
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit a0b81b1. Configure here.

Moves the four inline Jinja2 chat template strings from
chat_template_utils.pyinto separate.jinjafiles undertrl/chat_templates/, with a README explaining their purpose and the training template diffs.These templates are large (up to ~8K chars) and make
chat_template_utils.pyhard to navigate. Storing them as.jinjafiles makes them easier to read, diff, and edit and enables syntax highlighting in editors.Requires #5458
Note
Medium Risk
Moderate risk because
trl.chat_template_utilsnow reads template text from package files at import time; missing/incorrectly packaged template files would break schema detection and training template patching for Qwen models.Overview
Moves the Qwen3/Qwen3.5 Jinja2 chat templates out of
chat_template_utils.pyinto standalone files undertrl/chat_templates/, and updates the Python constants to load them viaPath(...).read_text().Adds
trl/chat_templates/README.mddocumenting the identity-comparison vs training-patch templates, and updatesMANIFEST.into include the new.jinjaand.mdtemplate assets in source distributions.Reviewed by Cursor Bugbot for commit e37fe00. Bugbot is set up for automated code reviews on this repo. Configure here.