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 Han6aa0fc7e287d
diff --git a/unsloth/models/rl.py b/unsloth/models/rl.py
index 6603346fd04..d77a4b37845 100644
--- a/unsloth/models/rl.py
+++ b/unsloth/models/rl.py
@@ -39,15 +39,14 @@ def PatchRL(FastLanguageModel):
@contextmanager
def unsloth_unwrap_model_for_generation(model, *args, **kwargs):
# Must use for_inference to allow inference in Unsloth
- print("$$$$$$$$$$$$$$")
- FastLanguageModel.for_inference(model)
- try:
- with unwrap_model_for_generation(model, *args, **kwargs) as unwrapped_model:
+ with unwrap_model_for_generation(model, accelerator) as unwrapped_model:
+ FastLanguageModel.for_inference(unwrapped_model)
+ try:
yield unwrapped_model
- finally:
- # Finally return back training
- FastLanguageModel.for_training(model)
- print("###############")
+ finally:
+ # Finally return back training
+ FastLanguageModel.for_training(model)
+ pass
pass
pass