zeusfsx commited on
Commit
88cb7d4
1 Parent(s): 858f2b4

update sharding

Browse files
Files changed (1) hide show
  1. ukrainian-news.py +5 -5
ukrainian-news.py CHANGED
@@ -45,17 +45,17 @@ class UkrainianNews(datasets.GeneratorBasedBuilder):
45
  )
46
 
47
  def _split_generators(self, dl_manager):
48
- downloaded_files = dl_manager.download_and_extract(_URLS)
49
 
50
  return [
51
- datasets.SplitGenerator(name=datasets.Split.TRAIN, gen_kwargs={"filepath": downloaded_files})
52
  ]
53
 
54
- def _generate_examples(self, filepath):
55
  """This function returns the examples in the raw (text) form."""
56
- logger.info("generating examples from = %s", filepath)
57
  key = 0
58
- for path in filepath:
59
  with open(path, encoding="utf-8") as f:
60
  news = json.load(f)
61
  for article in news:
 
45
  )
46
 
47
  def _split_generators(self, dl_manager):
48
+ downloaded_files = dl_manager.download(_URLS)
49
 
50
  return [
51
+ datasets.SplitGenerator(name=datasets.Split.TRAIN, gen_kwargs={"filepaths": downloaded_files})
52
  ]
53
 
54
+ def _generate_examples(self, filepaths):
55
  """This function returns the examples in the raw (text) form."""
56
+ logger.info("generating examples from = %s", filepaths)
57
  key = 0
58
+ for path in filepaths:
59
  with open(path, encoding="utf-8") as f:
60
  news = json.load(f)
61
  for article in news: