Skip to content

Commit c686d7d

Browse files
Raise FutureWarning for classes moved to experimental (#4605)
1 parent c7d172b commit c686d7d

19 files changed

+78
-26
lines changed

trl/trainer/bco_config.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@ def __post_init__(self):
2424
warnings.warn(
2525
"The `BCOConfig` is now located in `trl.experimental`. Please update your imports to "
2626
"`from trl.experimental.bco import BCOConfig`. The current import path will be removed and no longer "
27-
"supported in TRL 0.29. For more information, see https://github.com/huggingface/trl/issues/4223."
27+
"supported in TRL 0.29. For more information, see https://github.com/huggingface/trl/issues/4223.",
28+
FutureWarning,
29+
stacklevel=2,
2830
)
2931
super().__post_init__()

trl/trainer/bco_trainer.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@ def __init__(self, *args, **kwargs):
2424
warnings.warn(
2525
"The `BCOTrainer` is now located in `trl.experimental`. Please update your imports to "
2626
"`from trl.experimental.bco import BCOTrainer`. The current import path will be removed and no longer "
27-
"supported in TRL 0.29. For more information, see https://github.com/huggingface/trl/issues/4223."
27+
"supported in TRL 0.29. For more information, see https://github.com/huggingface/trl/issues/4223.",
28+
FutureWarning,
29+
stacklevel=2,
2830
)
2931
super().__init__(*args, **kwargs)

trl/trainer/callbacks.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -271,7 +271,9 @@ def __init__(self, *args, **kwargs):
271271
"The `WinRateCallback` is now located in `trl.experimental`. Please update your imports to "
272272
"`from trl.experimental.winrate_callback import WinRateCallback`. The current import path will be removed "
273273
"and no longer supported in TRL 0.29. For more information, see "
274-
"https://github.com/huggingface/trl/issues/4223."
274+
"https://github.com/huggingface/trl/issues/4223.",
275+
FutureWarning,
276+
stacklevel=2,
275277
)
276278
super().__init__(*args, **kwargs)
277279

trl/trainer/cpo_config.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@ def __post_init__(self):
2424
warnings.warn(
2525
"The `CPOConfig` is now located in `trl.experimental`. Please update your imports to "
2626
"`from trl.experimental.cpo import CPOConfig`. The current import path will be removed and no longer "
27-
"supported in TRL 0.29. For more information, see https://github.com/huggingface/trl/issues/4223."
27+
"supported in TRL 0.29. For more information, see https://github.com/huggingface/trl/issues/4223.",
28+
FutureWarning,
29+
stacklevel=2,
2830
)
2931
super().__post_init__()

trl/trainer/gkd_config.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@ def __post_init__(self):
2424
warnings.warn(
2525
"The `GKDConfig` is now located in `trl.experimental`. Please update your imports to "
2626
"`from trl.experimental.gkd import GKDConfig`. The current import path will be removed and no longer "
27-
"supported in TRL 0.29. For more information, see https://github.com/huggingface/trl/issues/4223."
27+
"supported in TRL 0.29. For more information, see https://github.com/huggingface/trl/issues/4223.",
28+
FutureWarning,
29+
stacklevel=2,
2830
)
2931
super().__post_init__()

trl/trainer/gkd_trainer.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@ def __init__(self, *args, **kwargs):
2424
warnings.warn(
2525
"The `GKDTrainer` is now located in `trl.experimental`. Please update your imports to "
2626
"`from trl.experimental.gkd import GKDTrainer`. The current import path will be removed and no longer "
27-
"supported in TRL 0.29. For more information, see https://github.com/huggingface/trl/issues/4223."
27+
"supported in TRL 0.29. For more information, see https://github.com/huggingface/trl/issues/4223.",
28+
FutureWarning,
29+
stacklevel=2,
2830
)
2931
super().__init__(*args, **kwargs)

trl/trainer/judges.py

Lines changed: 24 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,9 @@ def __init__(self, *args, **kwargs):
2929
warnings.warn(
3030
"The `AllTrueJudge` is now located in `trl.experimental`. Please update your imports to "
3131
"`from trl.experimental.judges import AllTrueJudge`. The current import path will be removed and no "
32-
"longer supported in TRL 0.29."
32+
"longer supported in TRL 0.29.",
33+
FutureWarning,
34+
stacklevel=2,
3335
)
3436
super().__init__(*args, **kwargs)
3537

@@ -39,7 +41,9 @@ def __init__(self, *args, **kwargs):
3941
warnings.warn(
4042
"The `BaseBinaryJudge` is now located in `trl.experimental`. Please update your imports to "
4143
"`from trl.experimental.judges import BaseBinaryJudge`. The current import path will be removed and no "
42-
"longer supported in TRL 0.29."
44+
"longer supported in TRL 0.29.",
45+
FutureWarning,
46+
stacklevel=2,
4347
)
4448
super().__init__(*args, **kwargs)
4549

@@ -49,7 +53,9 @@ def __init__(self, *args, **kwargs):
4953
warnings.warn(
5054
"The `BaseJudge` is now located in `trl.experimental`. Please update your imports to "
5155
"`from trl.experimental.judges import BaseJudge`. The current import path will be removed and no "
52-
"longer supported in TRL 0.29."
56+
"longer supported in TRL 0.29.",
57+
FutureWarning,
58+
stacklevel=2,
5359
)
5460
super().__init__(*args, **kwargs)
5561

@@ -59,7 +65,9 @@ def __init__(self, *args, **kwargs):
5965
warnings.warn(
6066
"The `BasePairwiseJudge` is now located in `trl.experimental`. Please update your imports to "
6167
"`from trl.experimental.judges import BasePairwiseJudge`. The current import path will be removed and no "
62-
"longer supported in TRL 0.29."
68+
"longer supported in TRL 0.29.",
69+
FutureWarning,
70+
stacklevel=2,
6371
)
6472
super().__init__(*args, **kwargs)
6573

@@ -69,7 +77,9 @@ def __init__(self, *args, **kwargs):
6977
warnings.warn(
7078
"The `BaseRankJudge` is now located in `trl.experimental`. Please update your imports to "
7179
"`from trl.experimental.judges import BaseRankJudge`. The current import path will be removed and no "
72-
"longer supported in TRL 0.29."
80+
"longer supported in TRL 0.29.",
81+
FutureWarning,
82+
stacklevel=2,
7383
)
7484
super().__init__(*args, **kwargs)
7585

@@ -79,7 +89,9 @@ def __init__(self, *args, **kwargs):
7989
warnings.warn(
8090
"The `HfPairwiseJudge` is now located in `trl.experimental`. Please update your imports to "
8191
"`from trl.experimental.judges import HfPairwiseJudge`. The current import path will be removed and no "
82-
"longer supported in TRL 0.29."
92+
"longer supported in TRL 0.29.",
93+
FutureWarning,
94+
stacklevel=2,
8395
)
8496
super().__init__(*args, **kwargs)
8597

@@ -89,7 +101,9 @@ def __init__(self, *args, **kwargs):
89101
warnings.warn(
90102
"The `OpenAIPairwiseJudge` is now located in `trl.experimental`. Please update your imports to "
91103
"`from trl.experimental.judges import OpenAIPairwiseJudge`. The current import path will be removed and no "
92-
"longer supported in TRL 0.29."
104+
"longer supported in TRL 0.29.",
105+
FutureWarning,
106+
stacklevel=2,
93107
)
94108
super().__init__(*args, **kwargs)
95109

@@ -99,6 +113,8 @@ def __init__(self, *args, **kwargs):
99113
warnings.warn(
100114
"The `PairRMJudge` is now located in `trl.experimental`. Please update your imports to "
101115
"`from trl.experimental.judges import PairRMJudge`. The current import path will be removed and no "
102-
"longer supported in TRL 0.29."
116+
"longer supported in TRL 0.29.",
117+
FutureWarning,
118+
stacklevel=2,
103119
)
104120
super().__init__(*args, **kwargs)

trl/trainer/nash_md_config.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@ def __post_init__(self):
2424
warnings.warn(
2525
"The `NashMDConfig` is now located in `trl.experimental`. Please update your imports to "
2626
"`from trl.experimental.nash_md import NashMDConfig`. The current import path will be removed and no "
27-
"longer supported in TRL 0.29. For more information, see https://github.com/huggingface/trl/issues/4223."
27+
"longer supported in TRL 0.29. For more information, see https://github.com/huggingface/trl/issues/4223.",
28+
FutureWarning,
29+
stacklevel=2,
2830
)
2931
super().__post_init__()

trl/trainer/nash_md_trainer.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@ def __init__(self, *args, **kwargs):
2424
warnings.warn(
2525
"The `NashMDTrainer` is now located in `trl.experimental`. Please update your imports to "
2626
"`from trl.experimental.nash_md import NashMDTrainer`. The current import path will be removed and no "
27-
"longer supported in TRL 0.29. For more information, see https://github.com/huggingface/trl/issues/4223."
27+
"longer supported in TRL 0.29. For more information, see https://github.com/huggingface/trl/issues/4223.",
28+
FutureWarning,
29+
stacklevel=2,
2830
)
2931
super().__init__(*args, **kwargs)

trl/trainer/online_dpo_config.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@ def __post_init__(self):
2525
"The `OnlineDPOConfig` is now located in `trl.experimental`. Please update your imports to "
2626
"`from trl.experimental.online_dpo import OnlineDPOConfig`. The current import path will be removed and "
2727
"no longer supported in TRL 0.29. For more information, see "
28-
"https://github.com/huggingface/trl/issues/4223."
28+
"https://github.com/huggingface/trl/issues/4223.",
29+
FutureWarning,
30+
stacklevel=2,
2931
)
3032
super().__post_init__()

0 commit comments

Comments
 (0)