chae-won-kim
commited on
Update Multidialog.py
Browse files- Multidialog.py +2 -7
Multidialog.py
CHANGED
@@ -36,7 +36,6 @@ _AUDIO_ARCHIVE_URL = _BASE_DATA_URL + "data/{subset}/{subset}_chunks_{archive_id
|
|
36 |
|
37 |
_META_URL = _BASE_DATA_URL + "metadata/{subset}/{subset}_metadata_{archive_id:04}.jsonl"
|
38 |
|
39 |
-
|
40 |
logger = datasets.utils.logging.get_logger(__name__)
|
41 |
|
42 |
|
@@ -81,10 +80,6 @@ class Multidialog(datasets.GeneratorBasedBuilder):
|
|
81 |
citation=_CITATION,
|
82 |
)
|
83 |
|
84 |
-
def _read_n_archives(self, n_archives_path):
|
85 |
-
with open(n_archives_path, encoding="utf-8") as f:
|
86 |
-
return int(f.read().strip())
|
87 |
-
|
88 |
def _split_generators(self, dl_manager):
|
89 |
splits = ("train", "test_freq", "test_rare", "valid_freq", "valid_rare")
|
90 |
|
@@ -108,7 +103,7 @@ class Multidialog(datasets.GeneratorBasedBuilder):
|
|
108 |
# flatten archives paths from
|
109 |
# {"train": {"xs": [path1, path2,], "s": [path3], "m": [path5, path5]}, "dev": {"dev": [path6,...]}, "test": {"test": [...]}}
|
110 |
# to {"train": [path1, path2, path3, path4, path5], "dev": [path6, ...], "test": [...]}
|
111 |
-
audio_archives_paths = _flatten_nested_dict(audio_archives_paths)
|
112 |
local_audio_archives_paths = dl_manager.extract(audio_archives_paths) if not dl_manager.is_streaming \
|
113 |
else None
|
114 |
|
@@ -121,7 +116,7 @@ class Multidialog(datasets.GeneratorBasedBuilder):
|
|
121 |
for split in splits
|
122 |
}
|
123 |
meta_paths = dl_manager.download_and_extract(meta_urls)
|
124 |
-
meta_paths = _flatten_nested_dict(meta_paths)
|
125 |
|
126 |
if self.config.name == "test_freq":
|
127 |
return [
|
|
|
36 |
|
37 |
_META_URL = _BASE_DATA_URL + "metadata/{subset}/{subset}_metadata_{archive_id:04}.jsonl"
|
38 |
|
|
|
39 |
logger = datasets.utils.logging.get_logger(__name__)
|
40 |
|
41 |
|
|
|
80 |
citation=_CITATION,
|
81 |
)
|
82 |
|
|
|
|
|
|
|
|
|
83 |
def _split_generators(self, dl_manager):
|
84 |
splits = ("train", "test_freq", "test_rare", "valid_freq", "valid_rare")
|
85 |
|
|
|
103 |
# flatten archives paths from
|
104 |
# {"train": {"xs": [path1, path2,], "s": [path3], "m": [path5, path5]}, "dev": {"dev": [path6,...]}, "test": {"test": [...]}}
|
105 |
# to {"train": [path1, path2, path3, path4, path5], "dev": [path6, ...], "test": [...]}
|
106 |
+
# audio_archives_paths = _flatten_nested_dict(audio_archives_paths)
|
107 |
local_audio_archives_paths = dl_manager.extract(audio_archives_paths) if not dl_manager.is_streaming \
|
108 |
else None
|
109 |
|
|
|
116 |
for split in splits
|
117 |
}
|
118 |
meta_paths = dl_manager.download_and_extract(meta_urls)
|
119 |
+
# meta_paths = _flatten_nested_dict(meta_paths)
|
120 |
|
121 |
if self.config.name == "test_freq":
|
122 |
return [
|