mirror of
https://github.com/huggingface/transformers.git
synced 2025-07-25 23:38:59 +06:00
add setter for trainer processor (#33911)
* add setter for trainer processor * Update src/transformers/trainer.py Co-authored-by: Quentin Gallouédec <45557362+qgallouedec@users.noreply.github.com> --------- Co-authored-by: Quentin Gallouédec <45557362+qgallouedec@users.noreply.github.com>
This commit is contained in:
parent
6500f78c86
commit
a220c5b99f
@ -742,6 +742,13 @@ class Trainer:
|
|||||||
logger.warning("Trainer.tokenizer is now deprecated. You should use Trainer.processing_class instead.")
|
logger.warning("Trainer.tokenizer is now deprecated. You should use Trainer.processing_class instead.")
|
||||||
return self.processing_class
|
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):
|
def _activate_neftune(self, model):
|
||||||
r"""
|
r"""
|
||||||
Activates the neftune as presented in this code: https://github.com/neelsjain/NEFTune and paper:
|
Activates the neftune as presented in this code: https://github.com/neelsjain/NEFTune and paper:
|
||||||
|
Loading…
Reference in New Issue
Block a user