lara-martin commited on
Commit
26ac6ab
1 Parent(s): b032afa

Update FIREBALL.py

Browse files
Files changed (1) hide show
  1. FIREBALL.py +5 -8
FIREBALL.py CHANGED
@@ -57,9 +57,9 @@ _URLS = {
57
  "FIREBALL": "https://huggingface.co/datasets/lara-martin/FIREBALL/tree/main/filtered",
58
  }
59
 
 
60
 
61
- # TODO: Name of the dataset usually matches the script name with CamelCase instead of snake_case
62
- class NewDataset(datasets.GeneratorBasedBuilder):
63
  """TODO: Short description of my dataset."""
64
 
65
  VERSION = datasets.Version("1.0.0")
@@ -77,7 +77,6 @@ class NewDataset(datasets.GeneratorBasedBuilder):
77
  datasets.BuilderConfig(name="FIREBALL", version=VERSION),
78
  ]
79
 
80
- DEFAULT_CONFIG_NAME = "FIREBALL" # It's not mandatory to have a default configuration. Just use one if it make sense.
81
 
82
  def _info(self):
83
 
@@ -180,16 +179,14 @@ class NewDataset(datasets.GeneratorBasedBuilder):
180
  )
181
 
182
  def _split_generators(self, dl_manager):
183
- # TODO: This method is tasked with downloading/extracting the data and defining the splits depending on the configuration
184
- # If several configurations are possible (listed in BUILDER_CONFIGS), the configuration selected by the user is in self.config.name
185
 
186
  # dl_manager is a datasets.download.DownloadManager that can be used to download and extract URLS
187
  # 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.
188
  # By default the archives will be extracted and a path to a cached folder where they are extracted is returned instead of the archive
189
- url = _URLS[self.config.name]
190
  #data_dir = dl_manager.download_and_extract(urls)
191
- print(url)
192
- downloaded_files = dl_manager.download([files for root,dir,files in os.walk(url)])
193
  print(downloaded_files)
194
  return [
195
  datasets.SplitGenerator(
 
57
  "FIREBALL": "https://huggingface.co/datasets/lara-martin/FIREBALL/tree/main/filtered",
58
  }
59
 
60
+ url = _URLS[self.config.name]
61
 
62
+ class Fireball(datasets.GeneratorBasedBuilder):
 
63
  """TODO: Short description of my dataset."""
64
 
65
  VERSION = datasets.Version("1.0.0")
 
77
  datasets.BuilderConfig(name="FIREBALL", version=VERSION),
78
  ]
79
 
 
80
 
81
  def _info(self):
82
 
 
179
  )
180
 
181
  def _split_generators(self, dl_manager):
182
+ # This method is tasked with downloading/extracting the data and defining the splits depending on the configuration
183
+
184
 
185
  # dl_manager is a datasets.download.DownloadManager that can be used to download and extract URLS
186
  # 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.
187
  # By default the archives will be extracted and a path to a cached folder where they are extracted is returned instead of the archive
 
188
  #data_dir = dl_manager.download_and_extract(urls)
189
+ downloaded_files = dl_manager.download([f for f in os.listdir(url) if os.path.isfile(f)])
 
190
  print(downloaded_files)
191
  return [
192
  datasets.SplitGenerator(