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 Han0974094f0214
diff --git a/unsloth/models/rl.py b/unsloth/models/rl.py
index 22e1e0f6cbf..e5101662b83 100644
--- a/unsloth/models/rl.py
+++ b/unsloth/models/rl.py
@@ -364,7 +364,7 @@ def _patch_trl_rl_trainers(trainer_file = "grpo_trainer"):
lora_name = trainer_file + "_lora_model"
source = re.sub(
r"(self\.llm\.(?:generate|chat)\([^\)]{1,})\)",
- r"\1, lora_request = model.load_lora('" + lora_name + r"', load_tensors = True))",
+ r"\1, lora_request = self.model.load_lora('" + lora_name + r"', load_tensors = True))",
source
)