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 Han79d2b0aea311
diff --git a/unsloth/models/rl.py b/unsloth/models/rl.pyindex c7858703069..22e1e0f6cbf 100644--- a/unsloth/models/rl.py+++ b/unsloth/models/rl.py@@ -353,6 +353,13 @@ def _patch_trl_rl_trainers(trainer_file = "grpo_trainer"):source,)+ # .state_dict()+ source = re.sub(+ r"\.state_dict\(\)",+ r"",+ source,+ )+# Replace self.llm.generate and self.llm.chatlora_name = trainer_file + "_lora_model"source = re.sub(@@ -382,6 +389,7 @@ def _patch_trl_rl_trainers(trainer_file = "grpo_trainer"):f"class {RLTrainer_name}", f"class Unsloth{RLTrainer_name}", 1)+ # Create new class in compiled cache and import itmodule = create_new_function(RLTrainer_name,RLTrainer_source,