Update multilingual_librispeech.py
Browse files
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
|
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])
|