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 Hanbfb3494b64a5
diff --git a/unsloth/models/rl.py b/unsloth/models/rl.pyindex df1f2f110d1..1b2f348541d 100644--- a/unsloth/models/rl.py+++ b/unsloth/models/rl.py@@ -558,7 +558,6 @@ def patch_functions(RLTrainer, trainer_file, RLTrainer_name, all_imports, importchanged = {"__init__" : (old_init, init,)}edit_functions = RL_FUNCTIONS.get(trainer_file, [])- remover = []for function in functions:if not hasattr(RLTrainer, function): continue@@ -602,9 +601,7 @@ def patch_functions(RLTrainer, trainer_file, RLTrainer_name, all_imports, import)# Skip if no changes done- if source == original_source:- remover.append(original_source)- continue+ if source == original_source: continue# Find all importsimports += [x for x in all_imports if not x.startswith("_") and x in source]@@ -621,11 +618,6 @@ def patch_functions(RLTrainer, trainer_file, RLTrainer_name, all_imports, importRLTrainer_source = RLTrainer_source.replace(old, new)pass- # Remove non editted functions- # for remove in remover:- # RLTrainer_source = RLTrainer_source.replace(remove, "")- # pass-RLTrainer_source = RLTrainer_source.replace(f"class {RLTrainer_name}", f"class _Unsloth{RLTrainer_name}", 1)