spacemanidol albertvillanova HF staff commited on
Commit
39b1296
1 Parent(s): d6e8397

Fix DuplicatedKeysError (#2)

Browse files

- Fix DuplicatedKeysError (b8b80d7489b3e8a2bbcf8f98c909616df3574425)


Co-authored-by: Albert Villanova <[email protected]>

Files changed (1) hide show
  1. ESCI-product-dataset.py +3 -1
ESCI-product-dataset.py CHANGED
@@ -71,8 +71,10 @@ class ESCIproduct(datasets.GeneratorBasedBuilder):
71
 
72
  def _generate_examples(self, files):
73
  """Yields examples."""
 
74
  for filepath in files:
75
  with open(filepath, encoding="utf-8") as f:
76
  for line in f:
77
  data = json.loads(line)
78
- yield data['query_id'], data
 
 
71
 
72
  def _generate_examples(self, files):
73
  """Yields examples."""
74
+ key = 0
75
  for filepath in files:
76
  with open(filepath, encoding="utf-8") as f:
77
  for line in f:
78
  data = json.loads(line)
79
+ yield key, data
80
+ key += 1