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 Han0aa4c035e86f
diff --git a/unsloth/models/rl.py b/unsloth/models/rl.py
index 932a29f78a0..2282e8b3134 100644
--- a/unsloth/models/rl.py
+++ b/unsloth/models/rl.py
@@ -43,8 +43,7 @@ def PatchRL(FastLanguageModel):
FastLanguageModel.for_inference(unwrapped_model)
yield unwrapped_model
# Return back to training mode
- FastLanguageModel.for_training (model)
- yield model
+ FastLanguageModel.for_training(model)
pass
import trl.trainer