albertvillanova HF staff commited on
Commit
f1d92a8
1 Parent(s): eb4f65e

Fix DuplicatedKeysError while loading multiple corpora (#2)

Browse files

- Fix DuplicatedKeysError while loading multiple corpora (76b0a36e56fbda8a45da0a7797920259b611b18e)

Files changed (1) hide show
  1. large_spanish_corpus.py +1 -1
large_spanish_corpus.py CHANGED
@@ -113,9 +113,9 @@ class LargeSpanishCorpus(datasets.GeneratorBasedBuilder):
113
  return [datasets.SplitGenerator(name=datasets.Split.TRAIN, gen_kwargs={"data_dir": data_dir})]
114
 
115
  def _generate_examples(self, data_dir):
 
116
  for filepath in self.config.filepaths:
117
  filepath = os.path.join(data_dir, filepath)
118
- _id = 0
119
  with open(filepath, mode="r", encoding="utf-8") as f:
120
  for line in f:
121
  yield _id, {"text": line.strip()},
 
113
  return [datasets.SplitGenerator(name=datasets.Split.TRAIN, gen_kwargs={"data_dir": data_dir})]
114
 
115
  def _generate_examples(self, data_dir):
116
+ _id = 0
117
  for filepath in self.config.filepaths:
118
  filepath = os.path.join(data_dir, filepath)
 
119
  with open(filepath, mode="r", encoding="utf-8") as f:
120
  for line in f:
121
  yield _id, {"text": line.strip()},