Datasets:
Modalities:
Text
Size:
10K - 100K
dvoice11
Browse files- common_voice_11_0.py +2 -3
common_voice_11_0.py
CHANGED
@@ -162,6 +162,7 @@ class CommonVoice(datasets.GeneratorBasedBuilder):
|
|
162 |
return split_generators
|
163 |
|
164 |
def _generate_examples(self, local_extracted_archive_paths, archives, meta_path):
|
|
|
165 |
data_fields = list(self._info().features.keys())
|
166 |
metadata = {}
|
167 |
with open(meta_path, encoding="utf-8") as f:
|
@@ -182,13 +183,11 @@ class CommonVoice(datasets.GeneratorBasedBuilder):
|
|
182 |
for i, audio_archive in enumerate(archives):
|
183 |
for filename, file in audio_archive:
|
184 |
_, filename = os.path.split(filename)
|
185 |
-
print(filename)
|
186 |
if filename in metadata:
|
187 |
result = dict(metadata[filename])
|
188 |
# set the audio feature and the path to the extracted file
|
189 |
path = os.path.join(local_extracted_archive_paths[i], filename) if local_extracted_archive_paths else filename
|
190 |
-
|
191 |
-
result["audio"] = {"path": path, "bytes": None} # <-- Add this line
|
192 |
# set path to None if the audio file doesn't exist locally (i.e. in streaming mode)
|
193 |
result["path"] = path if local_extracted_archive_paths else filename
|
194 |
|
|
|
162 |
return split_generators
|
163 |
|
164 |
def _generate_examples(self, local_extracted_archive_paths, archives, meta_path):
|
165 |
+
print("Moooooooook")
|
166 |
data_fields = list(self._info().features.keys())
|
167 |
metadata = {}
|
168 |
with open(meta_path, encoding="utf-8") as f:
|
|
|
183 |
for i, audio_archive in enumerate(archives):
|
184 |
for filename, file in audio_archive:
|
185 |
_, filename = os.path.split(filename)
|
|
|
186 |
if filename in metadata:
|
187 |
result = dict(metadata[filename])
|
188 |
# set the audio feature and the path to the extracted file
|
189 |
path = os.path.join(local_extracted_archive_paths[i], filename) if local_extracted_archive_paths else filename
|
190 |
+
result["audio"] = {"path": path, "bytes": file.read()}
|
|
|
191 |
# set path to None if the audio file doesn't exist locally (i.e. in streaming mode)
|
192 |
result["path"] = path if local_extracted_archive_paths else filename
|
193 |
|