From 5a1d84fc245437f46b3fb0e55e4e7e2c972e48b5 Mon Sep 17 00:00:00 2001 From: Daniel Han Date: Thu, 6 Feb 2025 01:06:20 -0800 Subject: [PATCH] Update rl.py --- 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 ef2fcb5675..0a516bce2a 100644 --- a/unsloth/models/rl.py +++ b/unsloth/models/rl.py @@ -371,7 +371,7 @@ def _patch_trl_rl_trainers(trainer_file = "grpo_trainer"): # Import all functions imports = list(set(imports)) imports = f"from trl.trainer.{trainer_file} import (\n" + ',\n'.join(imports) + ")" - exec(imports) + exec(imports, locals(), globals()) # Patch all functions for function in changed: