mnaguib commited on
Commit
d60d054
·
1 Parent(s): 1ceef0b

fix : back to dl_manager

Browse files
Files changed (1) hide show
  1. QuaeroFrenchMed.py +4 -11
QuaeroFrenchMed.py CHANGED
@@ -88,21 +88,14 @@ class QuaeroFrenchMed(datasets.GeneratorBasedBuilder):
88
  )
89
 
90
  def _split_generators(self, dl_manager):
91
- #check if the script can see the data
92
- if os.path.isdir(os.path.join(os.getcwd(), "data")):
93
- data_dir = os.path.join(os.getcwd(), "data")
94
- else:
95
- data_dir = snapshot_download(repo_id="meczifho/QuaeroFrenchMed",
96
- repo_type="dataset",
97
- cache_dir=".cache",
98
- )
99
- data_dir = os.path.join(data_dir, "data")
100
  return [
101
  datasets.SplitGenerator(
102
  name=datasets.Split.TRAIN,
103
  # These kwargs will be passed to _generate_examples
104
  gen_kwargs={
105
- "filepath": os.path.join(data_dir,"train.parquet"),
106
  "split": "train",
107
  },
108
  ),
@@ -110,7 +103,7 @@ class QuaeroFrenchMed(datasets.GeneratorBasedBuilder):
110
  name=datasets.Split.TEST,
111
  # These kwargs will be passed to _generate_examples
112
  gen_kwargs={
113
- "filepath": os.path.join(data_dir,"test.parquet"),
114
  "split": "test"
115
  },
116
  ),
 
88
  )
89
 
90
  def _split_generators(self, dl_manager):
91
+ train_pq = dl_manager.download_and_extract('https://huggingface.co/datasets/meczifho/QuaeroFrenchMed/resolve/main/data/train.parquet')
92
+ test_pq = dl_manager.download_and_extract('https://huggingface.co/datasets/meczifho/QuaeroFrenchMed/resolve/main/data/test.parquet')
 
 
 
 
 
 
 
93
  return [
94
  datasets.SplitGenerator(
95
  name=datasets.Split.TRAIN,
96
  # These kwargs will be passed to _generate_examples
97
  gen_kwargs={
98
+ "filepath": train_pq,
99
  "split": "train",
100
  },
101
  ),
 
103
  name=datasets.Split.TEST,
104
  # These kwargs will be passed to _generate_examples
105
  gen_kwargs={
106
+ "filepath": test_pq,
107
  "split": "test"
108
  },
109
  ),