diff --git a/tests/test_trainers_args.py b/tests/test_trainers_args.py index 3aff81fd3f..25ed71ff0b 100644 --- a/tests/test_trainers_args.py +++ b/tests/test_trainers_args.py @@ -153,7 +153,6 @@ def test_dpo(self): max_length=256, max_prompt_length=64, max_completion_length=64, - is_encoder_decoder=True, disable_dropout=False, # generate_during_eval=True, # ignore this one, it requires wandb precompute_ref_log_probs=True, @@ -188,7 +187,6 @@ def test_dpo(self): self.assertEqual(trainer.args.max_length, 256) self.assertEqual(trainer.args.max_prompt_length, 64) self.assertEqual(trainer.args.max_completion_length, 64) - self.assertEqual(trainer.args.is_encoder_decoder, True) self.assertEqual(trainer.args.disable_dropout, False) # self.assertEqual(trainer.args.generate_during_eval, True) self.assertEqual(trainer.args.precompute_ref_log_probs, True) diff --git a/trl/trainer/dpo_config.py b/trl/trainer/dpo_config.py index a3cdc28d28..55c6ecc7c8 100644 --- a/trl/trainer/dpo_config.py +++ b/trl/trainer/dpo_config.py @@ -12,7 +12,6 @@ # See the License for the specific language governing permissions and # limitations under the License. -import warnings from dataclasses import dataclass, field from enum import Enum from typing import Any, Callable, Optional, Union @@ -385,18 +384,3 @@ class DPOConfig(TrainingArguments): "Comet during evaluation." }, ) - - # Deprecated parameters - is_encoder_decoder: Optional[bool] = field( - default=None, - metadata={"help": "Deprecated. This argument is not used anymore."}, - ) - - def __post_init__(self): - if self.is_encoder_decoder is not None: - warnings.warn( - "The `is_encoder_decoder` parameter is deprecated will be removed in version 0.15. The trainer now " - "automatically determines if the model is an encoder-decoder, so you can safely remove it." - ) - - return super().__post_init__() diff --git a/trl/trainer/orpo_trainer.py b/trl/trainer/orpo_trainer.py index 06457683e8..832927d05c 100644 --- a/trl/trainer/orpo_trainer.py +++ b/trl/trainer/orpo_trainer.py @@ -50,7 +50,6 @@ from transformers.trainer_callback import TrainerCallback from transformers.trainer_utils import EvalLoopOutput from transformers.utils import is_peft_available, is_torch_fx_proxy -from transformers.utils.deprecation import deprecate_kwarg from ..data_utils import maybe_apply_chat_template, maybe_extract_prompt from ..models import PreTrainedModelWrapper @@ -119,9 +118,6 @@ class ORPOTrainer(Trainer): _tag_names = ["trl", "orpo"] - @deprecate_kwarg( - "tokenizer", "0.15.0", "processing_class", warn_if_greater_or_equal_version=True, raise_if_both_names=True - ) def __init__( self, model: Optional[Union[PreTrainedModel, nn.Module, str]] = None, diff --git a/trl/trainer/ppo_trainer.py b/trl/trainer/ppo_trainer.py index 83926cfd6a..27cbdd016c 100644 --- a/trl/trainer/ppo_trainer.py +++ b/trl/trainer/ppo_trainer.py @@ -46,7 +46,6 @@ from transformers.trainer import DEFAULT_CALLBACKS, DEFAULT_PROGRESS_CALLBACK from transformers.trainer_callback import CallbackHandler, ExportableState, PrinterCallback from transformers.utils import is_peft_available -from transformers.utils.deprecation import deprecate_kwarg from ..core import masked_mean, masked_whiten from ..models import create_reference_model @@ -98,14 +97,6 @@ def forward(self, **kwargs): class PPOTrainer(Trainer): _tag_names = ["trl", "ppo"] - @deprecate_kwarg("config", "0.15.0", "args", warn_if_greater_or_equal_version=True, raise_if_both_names=True) - @deprecate_kwarg( - "tokenizer", "0.15.0", "processing_class", warn_if_greater_or_equal_version=True, raise_if_both_names=True - ) - @deprecate_kwarg("policy", "0.15.0", "model", warn_if_greater_or_equal_version=True, raise_if_both_names=True) - @deprecate_kwarg( - "ref_policy", "0.15.0", "ref_model", warn_if_greater_or_equal_version=True, raise_if_both_names=True - ) def __init__( self, args: PPOConfig, diff --git a/trl/trainer/reward_trainer.py b/trl/trainer/reward_trainer.py index ea25b425ab..063fe5e8e8 100644 --- a/trl/trainer/reward_trainer.py +++ b/trl/trainer/reward_trainer.py @@ -39,7 +39,6 @@ from transformers.trainer_pt_utils import nested_detach from transformers.trainer_utils import EvalPrediction from transformers.utils import is_peft_available -from transformers.utils.deprecation import deprecate_kwarg from ..data_utils import maybe_apply_chat_template from .reward_config import RewardConfig @@ -84,9 +83,6 @@ def _tokenize(batch: dict[str, list[Any]], tokenizer: "PreTrainedTokenizerBase") class RewardTrainer(Trainer): _tag_names = ["trl", "reward-trainer"] - @deprecate_kwarg( - "tokenizer", "0.15.0", "processing_class", warn_if_greater_or_equal_version=True, raise_if_both_names=True - ) def __init__( self, model: Optional[Union[PreTrainedModel, nn.Module]] = None,