Datasets:
Upload open_cortex_fx_v3.py with huggingface_hub
Browse files- open_cortex_fx_v3.py +15 -11
open_cortex_fx_v3.py
CHANGED
|
@@ -60,20 +60,24 @@ class OpenCortexFXv3(datasets.GeneratorBasedBuilder):
|
|
| 60 |
|
| 61 |
def _split_generators(self, dl_manager: datasets.DownloadManager):
|
| 62 |
"""Returns SplitGenerators."""
|
| 63 |
-
|
| 64 |
-
|
| 65 |
-
|
| 66 |
-
|
|
|
|
|
|
|
|
|
|
| 67 |
|
| 68 |
splits = []
|
| 69 |
-
for
|
| 70 |
-
|
| 71 |
-
|
| 72 |
-
|
| 73 |
-
|
| 74 |
-
|
|
|
|
|
|
|
| 75 |
)
|
| 76 |
-
)
|
| 77 |
|
| 78 |
return splits
|
| 79 |
|
|
|
|
| 60 |
|
| 61 |
def _split_generators(self, dl_manager: datasets.DownloadManager):
|
| 62 |
"""Returns SplitGenerators."""
|
| 63 |
+
# Download all zip files
|
| 64 |
+
zip_urls = [
|
| 65 |
+
f"https://huggingface.co/datasets/Standout/open-cortex-fx-v3/resolve/main/final_{i}.zip"
|
| 66 |
+
for i in range(10) # Support up to 10 splits
|
| 67 |
+
]
|
| 68 |
+
|
| 69 |
+
zip_paths = dl_manager.download(zip_urls)
|
| 70 |
|
| 71 |
splits = []
|
| 72 |
+
for idx, zip_path in enumerate(zip_paths):
|
| 73 |
+
if zip_path and Path(zip_path).exists():
|
| 74 |
+
split_name = f"final_{idx}"
|
| 75 |
+
splits.append(
|
| 76 |
+
datasets.SplitGenerator(
|
| 77 |
+
name=datasets.Split(split_name),
|
| 78 |
+
gen_kwargs={"zip_path": Path(zip_path)},
|
| 79 |
+
)
|
| 80 |
)
|
|
|
|
| 81 |
|
| 82 |
return splits
|
| 83 |
|