visualjoyce commited on
Commit
e59bf55
1 Parent(s): cca18ed

fix download

Browse files
Files changed (1) hide show
  1. ipquiz.py +2 -4
ipquiz.py CHANGED
@@ -117,15 +117,13 @@ class IPQuizDataset(datasets.GeneratorBasedBuilder):
117
  # dl_manager is a datasets.download.DownloadManager that can be used to download and extract URLS
118
  # It can accept any type or nested list/dict and will give back the same structure with the url replaced with path to local files.
119
  # By default the archives will be extracted and a path to a cached folder where they are extracted is returned instead of the archive
120
- urls = _URLS[self.config.name]
121
- data_dir = dl_manager.download(urls)
122
- print(urls, data_dir)
123
  return [
124
  datasets.SplitGenerator(
125
  name=datasets.Split.TEST,
126
  # These kwargs will be passed to _generate_examples
127
  gen_kwargs={
128
- "filepath": os.path.join(data_dir, f"{self.config.name}.json"),
129
  "split": "test"
130
  },
131
  ),
 
117
  # dl_manager is a datasets.download.DownloadManager that can be used to download and extract URLS
118
  # It can accept any type or nested list/dict and will give back the same structure with the url replaced with path to local files.
119
  # By default the archives will be extracted and a path to a cached folder where they are extracted is returned instead of the archive
120
+ downloaded_files = dl_manager.download(_URLS)
 
 
121
  return [
122
  datasets.SplitGenerator(
123
  name=datasets.Split.TEST,
124
  # These kwargs will be passed to _generate_examples
125
  gen_kwargs={
126
+ "filepath": downloaded_files[self.config.name],
127
  "split": "test"
128
  },
129
  ),