Datasets:
Commit
•
58a692c
1
Parent(s):
e964511
Reset to original (#21)
Browse files- New Commit (a89151d051520fa57e64f07ed03885359ac6d2bc)
- Merge branch 'main' of https://huggingface.co/datasets/Aniket-Tathe-08/Custom_common_voice_dataset_using_RVC into pr/21 (83d172a0cd34de8b6225ad333a6ad289d2412075)
- Revert back to original config (e1d567002500b1a5401d80c60f1c56098134e757)
- Formatted (91a80402147be75c9330e4844e4ed02e99562e8d)
Co-authored-by: Anand Milind Kamble <anand-kamble@users.noreply.huggingface.co>
- common_voice_11_0.py +12 -7
common_voice_11_0.py
CHANGED
@@ -81,14 +81,16 @@ class CommonVoice(datasets.GeneratorBasedBuilder):
|
|
81 |
|
82 |
BUILDER_CONFIGS = [
|
83 |
CommonVoiceConfig(
|
84 |
-
name=
|
85 |
version=STATS["version"],
|
86 |
-
language=
|
87 |
release_date=STATS["date"],
|
88 |
num_clips=lang_stats["clips"],
|
89 |
num_speakers=lang_stats["users"],
|
90 |
-
validated_hr=float(
|
91 |
-
|
|
|
|
|
92 |
size_bytes=int(lang_stats["size"]) if lang_stats["size"] else None,
|
93 |
)
|
94 |
for lang, lang_stats in STATS["locales"].items()
|
@@ -142,9 +144,11 @@ class CommonVoice(datasets.GeneratorBasedBuilder):
|
|
142 |
]
|
143 |
print(audio_urls)
|
144 |
archive_paths = dl_manager.download(audio_urls)
|
145 |
-
local_extracted_archive_paths = dl_manager.extract(
|
|
|
146 |
|
147 |
-
meta_urls = {split: _TRANSCRIPT_URL.format(
|
|
|
148 |
meta_paths = dl_manager.download_and_extract(meta_urls)
|
149 |
|
150 |
split_generators = []
|
@@ -191,7 +195,8 @@ class CommonVoice(datasets.GeneratorBasedBuilder):
|
|
191 |
if filename in metadata:
|
192 |
result = dict(metadata[filename])
|
193 |
# set the audio feature and the path to the extracted file
|
194 |
-
path = os.path.join(
|
|
|
195 |
result["audio"] = {"path": path, "bytes": file.read()}
|
196 |
result["path"] = path
|
197 |
yield path, result
|
|
|
81 |
|
82 |
BUILDER_CONFIGS = [
|
83 |
CommonVoiceConfig(
|
84 |
+
name=lang,
|
85 |
version=STATS["version"],
|
86 |
+
language=LANGUAGES[lang],
|
87 |
release_date=STATS["date"],
|
88 |
num_clips=lang_stats["clips"],
|
89 |
num_speakers=lang_stats["users"],
|
90 |
+
validated_hr=float(
|
91 |
+
lang_stats["validHrs"]) if lang_stats["validHrs"] else None,
|
92 |
+
total_hr=float(lang_stats["totalHrs"]
|
93 |
+
) if lang_stats["totalHrs"] else None,
|
94 |
size_bytes=int(lang_stats["size"]) if lang_stats["size"] else None,
|
95 |
)
|
96 |
for lang, lang_stats in STATS["locales"].items()
|
|
|
144 |
]
|
145 |
print(audio_urls)
|
146 |
archive_paths = dl_manager.download(audio_urls)
|
147 |
+
local_extracted_archive_paths = dl_manager.extract(
|
148 |
+
archive_paths) if not dl_manager.is_streaming else {}
|
149 |
|
150 |
+
meta_urls = {split: _TRANSCRIPT_URL.format(
|
151 |
+
lang=lang, split=split) for split in splits}
|
152 |
meta_paths = dl_manager.download_and_extract(meta_urls)
|
153 |
|
154 |
split_generators = []
|
|
|
195 |
if filename in metadata:
|
196 |
result = dict(metadata[filename])
|
197 |
# set the audio feature and the path to the extracted file
|
198 |
+
path = os.path.join(
|
199 |
+
local_extracted_archive_paths[i], path) if local_extracted_archive_paths else path
|
200 |
result["audio"] = {"path": path, "bytes": file.read()}
|
201 |
result["path"] = path
|
202 |
yield path, result
|