anton-l HF staff commited on
Commit
eb9e960
1 Parent(s): 137923f

Update multilingual_librispeech.py

Browse files
Files changed (1) hide show
  1. multilingual_librispeech.py +2 -1
multilingual_librispeech.py CHANGED
@@ -22,6 +22,7 @@ import os
22
 
23
  import datasets
24
  from datasets.tasks import AutomaticSpeechRecognition
 
25
 
26
 
27
  _CITATION = """\
@@ -224,7 +225,7 @@ def download_audio_archives(dl_manager, root_dir, split):
224
  split_dir = os.path.join(root_dir, split)
225
  audio_filenames_path = dl_manager.download(os.path.join(split_dir, "audio_filenames.txt"))
226
 
227
- with open(audio_filenames_path, "r", encoding="utf-8") as file:
228
  audio_filenames = [line.strip() for line in file.readlines()]
229
 
230
  archive_paths = dl_manager.download([os.path.join(split_dir, "audio", filename) for filename in audio_filenames])
 
22
 
23
  import datasets
24
  from datasets.tasks import AutomaticSpeechRecognition
25
+ from datasets.utils.streaming_download_manager import xopen
26
 
27
 
28
  _CITATION = """\
 
225
  split_dir = os.path.join(root_dir, split)
226
  audio_filenames_path = dl_manager.download(os.path.join(split_dir, "audio_filenames.txt"))
227
 
228
+ with xopen(audio_filenames_path, "r", encoding="utf-8") as file:
229
  audio_filenames = [line.strip() for line in file.readlines()]
230
 
231
  archive_paths = dl_manager.download([os.path.join(split_dir, "audio", filename) for filename in audio_filenames])