From e38209de834b541190f4022bee7d0687c2e71aa1 Mon Sep 17 00:00:00 2001 From: Daniel Han Date: Mon, 1 Dec 2025 07:19:50 -0800 Subject: [PATCH] Update unsloth/models/rl.py Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com> --- unsloth/models/rl.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/unsloth/models/rl.py b/unsloth/models/rl.py index da163753a4..be9732db34 100644 --- a/unsloth/models/rl.py +++ b/unsloth/models/rl.py @@ -369,10 +369,9 @@ def _patch_trl_rl_trainers(trainer_file = "grpo_trainer"): ) return try: - RLConfig = eval(f"trl.trainer.{trainer_file}.{RLConfig_name}") - except: + except Exception as e: print( - f"Unsloth: Could not load {RLConfig_name} from trl.trainer.{trainer_file}" + f"Unsloth: Could not load {RLConfig_name} from trl.trainer.{trainer_file}: {e}" ) return