From c02d50883d43384256a7aaeff5edc8b4a213ff83 Mon Sep 17 00:00:00 2001 From: Albert Villanova del Moral <8515462+albertvillanova@users.noreply.github.com> Date: Thu, 4 Dec 2025 11:39:00 +0100 Subject: [PATCH 1/2] Raise FutureWarning for trainer moved to experimental --- trl/trainer/cpo_trainer.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/trl/trainer/cpo_trainer.py b/trl/trainer/cpo_trainer.py index b4a105fd47e..60884818e58 100644 --- a/trl/trainer/cpo_trainer.py +++ b/trl/trainer/cpo_trainer.py @@ -28,6 +28,8 @@ def __init__(self, *args, **kwargs): warnings.warn( "The `CPOTrainer` is now located in `trl.experimental`. Please update your imports to " "`from trl.experimental.cpo import CPOTrainer`. The current import path will be removed and no longer " - "supported in TRL 0.29. For more information, see https://github.com/huggingface/trl/issues/4223." + "supported in TRL 0.29. For more information, see https://github.com/huggingface/trl/issues/4223.", + FutureWarning, + stacklevel=2, ) super().__init__(*args, **kwargs) From 6aa384e3a2f3d9750565c74c0a0d4f2af99234e4 Mon Sep 17 00:00:00 2001 From: Albert Villanova del Moral <8515462+albertvillanova@users.noreply.github.com> Date: Fri, 5 Dec 2025 07:47:31 +0100 Subject: [PATCH 2/2] Raise FutureWarning for trainers to be moved to experimental --- trl/trainer/kto_trainer.py | 1 + trl/trainer/rloo_trainer.py | 1 + 2 files changed, 2 insertions(+) diff --git a/trl/trainer/kto_trainer.py b/trl/trainer/kto_trainer.py index 04486e446f1..7c266e3cb31 100644 --- a/trl/trainer/kto_trainer.py +++ b/trl/trainer/kto_trainer.py @@ -366,6 +366,7 @@ def __init__( "it and want it to remain, please share your comments here: " "https://github.com/huggingface/trl/issues/4223. Silence this warning by setting environment variable " "TRL_EXPERIMENTAL_SILENCE=1.", + FutureWarning, stacklevel=2, ) if type(args) is TrainingArguments: diff --git a/trl/trainer/rloo_trainer.py b/trl/trainer/rloo_trainer.py index a8c2a120325..c5a15ff2260 100644 --- a/trl/trainer/rloo_trainer.py +++ b/trl/trainer/rloo_trainer.py @@ -248,6 +248,7 @@ def __init__( "it and want it to remain, please share your comments here: " "https://github.com/huggingface/trl/issues/4223. Silence this warning by setting environment variable " "TRL_EXPERIMENTAL_SILENCE=1.", + FutureWarning, stacklevel=2, )