Update app.py
Browse files
app.py
CHANGED
@@ -90,9 +90,7 @@ class HySpeech(datasets.GeneratorBasedBuilder):
|
|
90 |
datasets.SplitGenerator(
|
91 |
name=datasets.Split.TRAIN,
|
92 |
gen_kwargs={
|
93 |
-
"audio_archives":
|
94 |
-
'hy': [dl_manager.iter_archive(archive) for archive in audio_paths["train"]]
|
95 |
-
},
|
96 |
"local_extracted_archives_paths": local_extracted_audio_paths["train"],
|
97 |
"metadata_paths": meta_paths["train"],
|
98 |
}
|
@@ -100,9 +98,7 @@ class HySpeech(datasets.GeneratorBasedBuilder):
|
|
100 |
datasets.SplitGenerator(
|
101 |
name=datasets.Split.VALIDATION,
|
102 |
gen_kwargs={
|
103 |
-
"audio_archives":
|
104 |
-
'hy': [dl_manager.iter_archive(archive) for archive in audio_paths["dev"]]
|
105 |
-
},
|
106 |
"local_extracted_archives_paths": local_extracted_audio_paths["dev"],
|
107 |
"metadata_paths": meta_paths["dev"],
|
108 |
}
|
@@ -110,9 +106,7 @@ class HySpeech(datasets.GeneratorBasedBuilder):
|
|
110 |
datasets.SplitGenerator(
|
111 |
name=datasets.Split.TEST,
|
112 |
gen_kwargs={
|
113 |
-
"audio_archives":
|
114 |
-
'hy': [dl_manager.iter_archive(archive) for archive in audio_paths["test"]]
|
115 |
-
},
|
116 |
"local_extracted_archives_paths": local_extracted_audio_paths["test"],
|
117 |
"metadata_paths": meta_paths["test"],
|
118 |
}
|
@@ -128,9 +122,8 @@ class HySpeech(datasets.GeneratorBasedBuilder):
|
|
128 |
with open(meta_path) as f:
|
129 |
metadata = {x["audio_path"].split(os.sep)[-1].split(".wav")[0]: x for x in csv.DictReader(f, delimiter="\t")}
|
130 |
|
131 |
-
print(metadata)
|
132 |
|
133 |
-
for audio_archive, local_extracted_archive_path in zip(audio_archives
|
134 |
for audio_filename, audio_file in audio_archive:
|
135 |
audio_id = audio_filename.split(os.sep)[-1].split(".wav")[0]
|
136 |
path = os.path.join(local_extracted_archive_path, audio_filename) if local_extracted_archive_path else audio_filename
|
|
|
90 |
datasets.SplitGenerator(
|
91 |
name=datasets.Split.TRAIN,
|
92 |
gen_kwargs={
|
93 |
+
"audio_archives": [dl_manager.iter_archive(archive) for archive in audio_paths["train"]],
|
|
|
|
|
94 |
"local_extracted_archives_paths": local_extracted_audio_paths["train"],
|
95 |
"metadata_paths": meta_paths["train"],
|
96 |
}
|
|
|
98 |
datasets.SplitGenerator(
|
99 |
name=datasets.Split.VALIDATION,
|
100 |
gen_kwargs={
|
101 |
+
"audio_archives": [dl_manager.iter_archive(archive) for archive in audio_paths["dev"]],
|
|
|
|
|
102 |
"local_extracted_archives_paths": local_extracted_audio_paths["dev"],
|
103 |
"metadata_paths": meta_paths["dev"],
|
104 |
}
|
|
|
106 |
datasets.SplitGenerator(
|
107 |
name=datasets.Split.TEST,
|
108 |
gen_kwargs={
|
109 |
+
"audio_archives": [dl_manager.iter_archive(archive) for archive in audio_paths["test"]],
|
|
|
|
|
110 |
"local_extracted_archives_paths": local_extracted_audio_paths["test"],
|
111 |
"metadata_paths": meta_paths["test"],
|
112 |
}
|
|
|
122 |
with open(meta_path) as f:
|
123 |
metadata = {x["audio_path"].split(os.sep)[-1].split(".wav")[0]: x for x in csv.DictReader(f, delimiter="\t")}
|
124 |
|
|
|
125 |
|
126 |
+
for audio_archive, local_extracted_archive_path in zip(audio_archives, local_extracted_archives_paths):
|
127 |
for audio_filename, audio_file in audio_archive:
|
128 |
audio_id = audio_filename.split(os.sep)[-1].split(".wav")[0]
|
129 |
path = os.path.join(local_extracted_archive_path, audio_filename) if local_extracted_archive_path else audio_filename
|