From a9eca743729f81e7605accc3148c5be659255dc4 Mon Sep 17 00:00:00 2001 From: Patrick von Platen Date: Wed, 25 May 2022 16:04:43 -0400 Subject: [PATCH] Wav2vec2 finetuning shared file system (#17423) * fix_torch_device_generate_test * remove @ * [Fix shared file system] Co-authored-by: Patrick von Platen --- .../speech-recognition/run_speech_recognition_ctc.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/examples/pytorch/speech-recognition/run_speech_recognition_ctc.py b/examples/pytorch/speech-recognition/run_speech_recognition_ctc.py index 84ec7b6a64..70ab4c1059 100755 --- a/examples/pytorch/speech-recognition/run_speech_recognition_ctc.py +++ b/examples/pytorch/speech-recognition/run_speech_recognition_ctc.py @@ -501,7 +501,12 @@ def main(): with training_args.main_process_first(): if training_args.overwrite_output_dir and os.path.isfile(vocab_file): - os.remove(vocab_file) + try: + os.remove(vocab_file) + except OSError: + # in shared file-systems it might be the case that + # two processes try to delete the vocab file at the some time + pass with training_args.main_process_first(desc="dataset map vocabulary creation"): if not os.path.isfile(vocab_file):