Skip to content

Commit

Permalink
Save the Wav2Vec2 processor before training starts (huggingface#10910)
Browse files Browse the repository at this point in the history
Co-authored-by: nithin19 <nithin@amberscript.com>
  • Loading branch information
2 people authored and Iwontbecreative committed Jul 15, 2021
1 parent 014d94c commit 20e9d22
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions examples/research_projects/wav2vec2/run_common_voice.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 20e9d22

Please sign in to comment.