Save the Wav2Vec2 processor before training starts (#10910)

Co-authored-by: nithin19 <nithin@amberscript.com>
This commit is contained in:
Nithin Holla
2021-04-14 13:52:06 +02:00
committed by GitHub
parent 3d339ee659
commit 653076ca30

View File

@@ -476,13 +476,14 @@ def main():
checkpoint = model_args.model_name_or_path
else:
checkpoint = None
train_result = trainer.train(resume_from_checkpoint=checkpoint)
trainer.save_model()
# save the feature_extractor and the tokenizer
# Save the feature_extractor and the tokenizer
if is_main_process(training_args.local_rank):
processor.save_pretrained(training_args.output_dir)
train_result = trainer.train(resume_from_checkpoint=checkpoint)
trainer.save_model()
metrics = train_result.metrics
max_train_samples = (
data_args.max_train_samples if data_args.max_train_samples is not None else len(train_dataset)