From 5e4bc50f1d5b9872d3ed021758102c281cd45e85 Mon Sep 17 00:00:00 2001 From: Datta Nimmaturi Date: Mon, 1 Dec 2025 11:47:51 +0000 Subject: [PATCH] do not patch base_trainer --- unsloth/models/rl.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/unsloth/models/rl.py b/unsloth/models/rl.py index 18103ca7eb..9fd9390a4b 100644 --- a/unsloth/models/rl.py +++ b/unsloth/models/rl.py @@ -1306,7 +1306,7 @@ def patch_trl_rl_trainers(): import trl.trainer all_trainers = dir(trl.trainer) - all_trainers = [x for x in all_trainers if x.islower() and x.endswith("_trainer")] + all_trainers = [x for x in all_trainers if x.islower() and x.endswith("_trainer") and x != "base_trainer"] for trainer in all_trainers: _patch_trl_rl_trainers(trainer) return