Update _get_eval_sampler to reflect Trainer.tokenizer is deprecation self.tokenizer -> self.processing_class (#36315)

* fix warning self.tokenizer -> self.processing_class

* formating change
This commit is contained in:
Jeff 2025-02-25 05:07:50 -05:00 committed by GitHub
parent 9d6abf9778
commit 92abc0dae8
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1060,7 +1060,9 @@ class Trainer:
)
else:
lengths = None
model_input_name = self.tokenizer.model_input_names[0] if self.tokenizer is not None else None
model_input_name = (
self.processing_class.model_input_names[0] if self.processing_class is not None else None
)
return LengthGroupedSampler(
self.args.eval_batch_size,
dataset=eval_dataset,