amphora commited on
Commit
603ef6b
1 Parent(s): 9607f98

Update csatqa.py

Browse files
Files changed (1) hide show
  1. csatqa.py +5 -2
csatqa.py CHANGED
@@ -55,7 +55,7 @@ class CSATQA(datasets.GeneratorBasedBuilder):
55
  train_path = dl_manager.download_and_extract("./data/csatqa_eval.json")
56
  return [
57
  datasets.SplitGenerator(
58
- # name=datasets.Split.TRAIN,
59
  gen_kwargs={
60
  "filepath": train_path,
61
  },
@@ -64,6 +64,9 @@ class CSATQA(datasets.GeneratorBasedBuilder):
64
 
65
  def _generate_examples(self, filepath):
66
  with open(filepath, encoding="utf-8") as f:
 
67
  for key, row in enumerate(f):
68
  data = json.loads(row)
69
- yield key, {"context":data["context"]}
 
 
 
55
  train_path = dl_manager.download_and_extract("./data/csatqa_eval.json")
56
  return [
57
  datasets.SplitGenerator(
58
+ name=datasets.Split.TRAIN,
59
  gen_kwargs={
60
  "filepath": train_path,
61
  },
 
64
 
65
  def _generate_examples(self, filepath):
66
  with open(filepath, encoding="utf-8") as f:
67
+ buffer = []
68
  for key, row in enumerate(f):
69
  data = json.loads(row)
70
+ buffer.append({"context":data["context"]})
71
+ for idx, dat in enumerate(buffer):
72
+ yield idx,dat