Skip to content
Draft
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
2 changes: 1 addition & 1 deletion skyrl-train/skyrl_train/generators/skyrl_gym_generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ def __init__(
self.use_conversation_multi_turn = generator_cfg.use_conversation_multi_turn

# optionally use custom chat template to get loss masks (i.e. for Qwen3)
self.custom_chat_template = get_custom_chat_template(model_name)
self.custom_chat_template = get_custom_chat_template(model_name, generator_cfg.get("train_on_thinking_tokens", False))
# get generation prompt ids for the tokenizer if needed
self.generation_prompt_ids = get_generation_prompt_ids(tokenizer) if self.use_conversation_multi_turn else None
if self.skyrl_gym_cfg.max_env_workers > 0:
Expand Down
4 changes: 2 additions & 2 deletions skyrl-train/skyrl_train/generators/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@
}


def get_custom_chat_template(model_name: str) -> str:
if "Qwen3" in model_name:
def get_custom_chat_template(model_name: str, train_on_thinking_tokens: bool = False) -> Optional[str]:
if "Qwen3" in model_name and not train_on_thinking_tokens:
return CUSTOM_CHAT_TEMPLATES["qwen3_thinking"]
else:
return None
Expand Down