ignore embeddings while streaming
Browse files
dcase23-task2-enriched.py
CHANGED
@@ -63,7 +63,7 @@ DATA_URLS = {
|
|
63 |
|
64 |
EMBEDDING_URLS = {
|
65 |
"dev": {
|
66 |
-
"ast-finetuned-audioset-10-10-0
|
67 |
"train": "data/MIT_ast-finetuned-audioset-10-10-0-4593-embeddings_dev_train.npz",
|
68 |
"test": "data/MIT_ast-finetuned-audioset-10-10-0-4593-embeddings_dev_test.npz",
|
69 |
"size": (1, 768),
|
@@ -263,7 +263,7 @@ class DCASE2023Task2Dataset(datasets.GeneratorBasedBuilder):
|
|
263 |
audio_path[split] = dl_manager.download(self.config.data_urls[split])
|
264 |
local_extracted_archive[split] = dl_manager.extract(
|
265 |
audio_path[split]) if not dl_manager.is_streaming else None
|
266 |
-
if self.config.embeddings_urls is not None:
|
267 |
for emb_name, emb_data in self.config.embeddings_urls.items():
|
268 |
downloaded_embeddings = dl_manager.download(emb_data[split])
|
269 |
embeddings[split][emb_name] = np.load(downloaded_embeddings, allow_pickle=True)["arr_0"].item()
|
@@ -310,4 +310,3 @@ class DCASE2023Task2Dataset(datasets.GeneratorBasedBuilder):
|
|
310 |
|
311 |
if __name__ == "__main__":
|
312 |
ds = load_dataset("dcase23-task2-enriched.py", "dev", split="train", streaming=True)
|
313 |
-
|
|
|
63 |
|
64 |
EMBEDDING_URLS = {
|
65 |
"dev": {
|
66 |
+
"ast-finetuned-audioset-10-10-0.4593-embeddings": {
|
67 |
"train": "data/MIT_ast-finetuned-audioset-10-10-0-4593-embeddings_dev_train.npz",
|
68 |
"test": "data/MIT_ast-finetuned-audioset-10-10-0-4593-embeddings_dev_test.npz",
|
69 |
"size": (1, 768),
|
|
|
263 |
audio_path[split] = dl_manager.download(self.config.data_urls[split])
|
264 |
local_extracted_archive[split] = dl_manager.extract(
|
265 |
audio_path[split]) if not dl_manager.is_streaming else None
|
266 |
+
if self.config.embeddings_urls is not None and not dl_manager.is_streaming:
|
267 |
for emb_name, emb_data in self.config.embeddings_urls.items():
|
268 |
downloaded_embeddings = dl_manager.download(emb_data[split])
|
269 |
embeddings[split][emb_name] = np.load(downloaded_embeddings, allow_pickle=True)["arr_0"].item()
|
|
|
310 |
|
311 |
if __name__ == "__main__":
|
312 |
ds = load_dataset("dcase23-task2-enriched.py", "dev", split="train", streaming=True)
|
|