Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions xtuner/v1/rl/rollout/chat_template.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ def canonicalize_messages_for_chat_template(messages: list[dict]) -> list[dict]:
template-renderable shape before ``apply_chat_template``. It must not
mutate model responses returned to the agent/client, nor the generated
token ids, labels, or raw rollout artifacts used for training.

``tool_calls[].function.arguments`` strings are parsed to dicts so the
template's ``tojson`` filter sees a real object.
"""

messages = copy.deepcopy(messages)
Expand Down
Loading
Loading