Skip to content
Open
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
4 changes: 3 additions & 1 deletion tunix/rl/rl_cluster.py
Original file line number Diff line number Diff line change
Expand Up @@ -794,6 +794,7 @@ def generate(
apply_chat_template: bool = False,
mode: Mode = Mode.TRAIN,
micro_batch_size: int | None = None,
enable_thinking: bool = False
) -> base_rollout.RolloutOutput:
"""Generates text from the given prompts.

Expand All @@ -806,6 +807,7 @@ def generate(
mode: The mode of rollout, either TRAIN or EVAL.
micro_batch_size: The micro-batch size for generation. If None, no
micro-batching is performed.
enable_thinking: Whether to enable reasoning for supported models.

Returns:
A `RolloutOutput` object containing the generated text and other info.
Expand All @@ -818,7 +820,7 @@ def generate(
prompt, # pytype: disable=wrong-arg-types
add_generation_prompt=True,
tokenize=False,
enable_thinking=False,
enable_thinking=enable_thinking
)
for prompt in prompts
]
Expand Down