Skip to content

Commit

Permalink
add setter for trainer processor (#33911)
Browse files Browse the repository at this point in the history
* add setter for trainer processor

* Update src/transformers/trainer.py

Co-authored-by: Quentin Gallouédec <[email protected]>

---------

Co-authored-by: Quentin Gallouédec <[email protected]>
  • Loading branch information
ArthurZucker and qgallouedec authored Oct 3, 2024
1 parent 6500f78 commit a220c5b
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/transformers/trainer.py
Original file line number Diff line number Diff line change
Expand Up @@ -742,6 +742,13 @@ def tokenizer(self) -> Optional[PreTrainedTokenizerBase]:
logger.warning("Trainer.tokenizer is now deprecated. You should use Trainer.processing_class instead.")
return self.processing_class

@tokenizer.setter
def tokenizer(self, processing_class) -> None:
logger.warning(
"Trainer.tokenizer is now deprecated. You should use `Trainer.processing_class = processing_class` instead."
)
self.processing_class = processing_class

def _activate_neftune(self, model):
r"""
Activates the neftune as presented in this code: https://github.com/neelsjain/NEFTune and paper:
Expand Down

0 comments on commit a220c5b

Please sign in to comment.