do not patch base_trainer

This commit is contained in:
Datta Nimmaturi 2025-12-01 11:47:51 +00:00
commit 5e4bc50f1d

View file

@ -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