bjelkenhed
commited on
Commit
•
dc94f26
1
Parent(s):
99f3be3
range(1,31) fix
Browse files- babelbox_voice.py +2 -29
babelbox_voice.py
CHANGED
@@ -83,7 +83,7 @@ class BabelboxVoice(datasets.GeneratorBasedBuilder):
|
|
83 |
|
84 |
def _split_generators(self, dl_manager: datasets.DownloadManager) -> List[datasets.SplitGenerator]:
|
85 |
|
86 |
-
_DL_URLS = [_DL_URL_FORMAT.format(i) for i in range(
|
87 |
|
88 |
archive_paths = dl_manager.download(_DL_URLS)
|
89 |
local_extracted_archive_paths = dl_manager.extract(archive_paths) if not dl_manager.is_streaming else {}
|
@@ -99,34 +99,7 @@ class BabelboxVoice(datasets.GeneratorBasedBuilder):
|
|
99 |
filename = row['filename_channel_1']
|
100 |
sentence = row['text']
|
101 |
metadata[filename] = sentence
|
102 |
-
|
103 |
-
|
104 |
-
"""
|
105 |
-
metadata = {}
|
106 |
-
if dl_manager.is_streaming:
|
107 |
-
meta_archive = dl_manager.iter_archive(_METADATA_URL)
|
108 |
-
for path, file in meta_archive:
|
109 |
-
reader = csv.DictReader(codecs.iterdecode(file, 'utf-8'))
|
110 |
-
for row in tqdm(reader, desc="Reading metadata..."):
|
111 |
-
filename = row['filename_channel_1']
|
112 |
-
sentence = row['text']
|
113 |
-
metadata[filename] = sentence
|
114 |
-
else:
|
115 |
-
metadata_path = dl_manager.download(_METADATA_URL)
|
116 |
-
local_extracted_metadata_path = dl_manager.extract(metadata_path)
|
117 |
-
metadata_path = Path(local_extracted_metadata_path)
|
118 |
-
for filename in metadata_path.glob("*.csv"):
|
119 |
-
with open(filename) as csv_file:
|
120 |
-
reader = csv.DictReader(csv_file)
|
121 |
-
for row in tqdm(reader, desc="Reading metadata..."):
|
122 |
-
filename = row['filename_channel_1']
|
123 |
-
sentence = row['text']
|
124 |
-
metadata[filename] = sentence
|
125 |
-
|
126 |
-
"""
|
127 |
-
|
128 |
-
|
129 |
-
|
130 |
return [
|
131 |
datasets.SplitGenerator(name=datasets.Split.TRAIN,
|
132 |
gen_kwargs={
|
|
|
83 |
|
84 |
def _split_generators(self, dl_manager: datasets.DownloadManager) -> List[datasets.SplitGenerator]:
|
85 |
|
86 |
+
_DL_URLS = [_DL_URL_FORMAT.format(i) for i in range(1,31) ]
|
87 |
|
88 |
archive_paths = dl_manager.download(_DL_URLS)
|
89 |
local_extracted_archive_paths = dl_manager.extract(archive_paths) if not dl_manager.is_streaming else {}
|
|
|
99 |
filename = row['filename_channel_1']
|
100 |
sentence = row['text']
|
101 |
metadata[filename] = sentence
|
102 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
103 |
return [
|
104 |
datasets.SplitGenerator(name=datasets.Split.TRAIN,
|
105 |
gen_kwargs={
|