From d3ac77a900ad913e63ece0c3acf317fe58aabf3c Mon Sep 17 00:00:00 2001 From: nithin19 Date: Thu, 25 Mar 2021 21:12:46 +0100 Subject: [PATCH] Save the Wav2Vec2 processor before training starts --- examples/research_projects/wav2vec2/run_common_voice.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/examples/research_projects/wav2vec2/run_common_voice.py b/examples/research_projects/wav2vec2/run_common_voice.py index 426de3729206a0..0f89dcf2b47f04 100644 --- a/examples/research_projects/wav2vec2/run_common_voice.py +++ b/examples/research_projects/wav2vec2/run_common_voice.py @@ -476,13 +476,14 @@ def compute_metrics(pred): 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)