standoutw commited on
Commit
b457b7a
·
verified ·
1 Parent(s): 2479dcf

Upload open_cortex_fx_v3.py with huggingface_hub

Browse files
Files changed (1) hide show
  1. 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
- data_dir = dl_manager.download_and_extract("https://huggingface.co/datasets/Standout/open-cortex-fx-v3/resolve/main/")
64
-
65
- # Find all zip files
66
- zip_files = sorted(Path(data_dir).glob("final_*.zip"))
 
 
 
67
 
68
  splits = []
69
- for zip_file in zip_files:
70
- split_name = zip_file.stem # e.g., "final_0"
71
- splits.append(
72
- datasets.SplitGenerator(
73
- name=datasets.Split(split_name),
74
- gen_kwargs={"zip_path": zip_file},
 
 
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