pere commited on
Commit
32cdcde
·
1 Parent(s): 767f3e9
run_flax_speech_recognition_seq2seq_streaming.py CHANGED
@@ -767,11 +767,13 @@ def main():
767
  # Add a folder for the mp3 files
768
  if not os.path.exists(os.path.join(predictions_folder_name,"mp3")):
769
  os.makedirs(os.path.join(predictions_folder_name,"mp3"))
770
-
771
- for idx,mp3array in enumerate(eval_samples[0:data_args.number_write_predictions]):
772
- audio_segment = AudioSegment(data=mp3array.tobytes(),sample_width=mp3array.dtype.itemsize,frame_rate=16000,channels=1)
773
- audio_segment.export(os.path.join(predictions_folder_name, "mp3")+"/pred_"+str(idx)+".mp3", format="mp3")
774
-
 
 
775
  logger.info(f"Created {stats_file_name} and updated the headers of the other stats files")
776
 
777
  # 9. Save feature extractor, tokenizer and config
 
767
  # Add a folder for the mp3 files
768
  if not os.path.exists(os.path.join(predictions_folder_name,"mp3")):
769
  os.makedirs(os.path.join(predictions_folder_name,"mp3"))
770
+
771
+ for idx, mp3array in enumerate(eval_samples[0:data_args.number_write_predictions]):
772
+ audio_segment = AudioSegment(data=mp3array.tobytes(), sample_width=mp3array.dtype.itemsize, frame_rate=16000, channels=1)
773
+ file_path = os.path.join(predictions_folder_name, "mp3") + "/pred_" + str(idx) + ".mp3"
774
+ if not os.path.exists(file_path):
775
+ audio_segment.export(file_path, format="mp3")
776
+
777
  logger.info(f"Created {stats_file_name} and updated the headers of the other stats files")
778
 
779
  # 9. Save feature extractor, tokenizer and config
run_streaming_ncc_short.sh CHANGED
@@ -1,3 +1,4 @@
 
1
  python run_flax_speech_recognition_seq2seq_streaming.py \
2
  --model_name_or_path openai/whisper-tiny \
3
  --dataset_name NbAiLab/NCC_S3_nrk \
 
1
+ export TOKENIZERS_PARALELLISM=true
2
  python run_flax_speech_recognition_seq2seq_streaming.py \
3
  --model_name_or_path openai/whisper-tiny \
4
  --dataset_name NbAiLab/NCC_S3_nrk \