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.
Python agentaichatgptdeepseekfine-tuninggemmaimage-generationllamallmllmsopenaipythonqwenreinforcement-learningself-hostedstable-diffusiontext-to-speechttsuiunsloth
Update rl.py
Daniel Han7dfd171c553f
diff --git a/unsloth/models/rl.py b/unsloth/models/rl.pyindex 2aa8f026597..2bd602e0995 100644--- a/unsloth/models/rl.py+++ b/unsloth/models/rl.py@@ -21,11 +21,12 @@ def PatchRL(FastLanguageModel):from trl.models.utils import unwrap_model_for_generationfrom contextlib import contextmanager-+@contextmanagerdef unsloth_unwrap_model_for_generation(model, *args, **kwargs):FastLanguageModel.for_inference(model)- yield unwrap_model_for_generation(model, *args, **kwargs)+ with unwrap_model_for_generation(model, *args, **kwargs) as unwrapped_model:+ yield unwrapped_modelFastLanguageModel.for_training (model)pass