Skip to content

Local UI to run and train LLMs and diffusion models. Supports GGUF, MLX, Qwen3.8, DeepSeek-V4.1, MiniMax-H3, Gemma 4, FLUX and more.

Update rl.py

Daniel Hanc95dea33a935
diff --git a/unsloth/models/rl.py b/unsloth/models/rl.py
index 84ab86dd49f..4a548f00002 100644
--- a/unsloth/models/rl.py
+++ b/unsloth/models/rl.py
@@ -717,7 +717,7 @@ def _patch_trl_rl_trainers(trainer_file = "grpo_trainer"):
num_proc_check = \
"if dataset_num_proc is None:\n"\
" from multiprocessing import cpu_count\n"\
- " dataset_num_proc = max(cpu_count()+4, 2)\n"
+ " dataset_num_proc = min(max(cpu_count()+4, 2), 64)\n"
extra_args += num_proc_check
pass