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