diff --git a/unsloth/trainer.py b/unsloth/trainer.py index 896db35ecd..25b8999959 100644 --- a/unsloth/trainer.py +++ b/unsloth/trainer.py @@ -201,7 +201,10 @@ pass def _patch_trl_trainer(): - if hasattr(trl, "__UNSLOTH_BACKWARDS_COMPATIBLE__"): return + try: + trl.__UNSLOTH_BACKWARDS_COMPATIBLE__ + return + except: pass if Version(trl.__version__) <= Version("0.11.0"): return import trl.trainer