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.

Auto patching

Daniel Han2aa87bd8f144
diff --git a/unsloth/models/llama.py b/unsloth/models/llama.py
index a337472a3e2..c50f65e4bd9 100644
--- a/unsloth/models/llama.py
+++ b/unsloth/models/llama.py
@@ -2739,3 +2739,5 @@ class FastLlamaModel:
pass
pass
+from .rl import PatchFastRL
+PatchFastRL(FastLanguageModel = FastLlamaModel)
diff --git a/unsloth/models/rl.py b/unsloth/models/rl.py
index e89e657fab8..31a745e0d14 100644
--- a/unsloth/models/rl.py
+++ b/unsloth/models/rl.py
@@ -453,5 +453,5 @@ pass
def PatchFastRL(algorithm = "GRPO", FastLanguageModel = None):
if FastLanguageModel is not None: PatchRL(FastLanguageModel)
patch_trl_rl_trainers()
- PatchRLStatistics(algorithm)
+ if algorithm is nont None: PatchRLStatistics(algorithm)
pass