echarlaix HF staff commited on
Commit
5a76297
1 Parent(s): 33b7d67

Change name variable for clarity

Browse files
Files changed (1) hide show
  1. gqa.py +6 -6
gqa.py CHANGED
@@ -55,9 +55,9 @@ class Gqa(datasets.GeneratorBasedBuilder):
55
  def _info(self):
56
  features = datasets.Features(
57
  {
58
- "input_ids": datasets.Value("string"),
59
- "img_id": datasets.Value("string"),
60
  "question_id": datasets.Value("int32"),
 
61
  "label": datasets.Value("int32"),
62
  }
63
  )
@@ -90,10 +90,10 @@ class Gqa(datasets.GeneratorBasedBuilder):
90
  gqa = json.load(f)
91
  for id_, d in enumerate(gqa):
92
  img_id = os.path.join(img_dir, d["img_id"] + ".jpg")
93
- label = self.ans2label[next(iter(d["label"].keys()))]
94
  yield id_, {
95
- "input_ids": d["sent"],
96
- "img_id": img_id,
97
- "label": label,
98
  "question_id": d["question_id"],
 
 
99
  }
 
55
  def _info(self):
56
  features = datasets.Features(
57
  {
58
+ "question": datasets.Value("string"),
 
59
  "question_id": datasets.Value("int32"),
60
+ "image_id": datasets.Value("string"),
61
  "label": datasets.Value("int32"),
62
  }
63
  )
 
90
  gqa = json.load(f)
91
  for id_, d in enumerate(gqa):
92
  img_id = os.path.join(img_dir, d["img_id"] + ".jpg")
93
+ label = self.ans2label[next(iter(d["label"]))]
94
  yield id_, {
95
+ "question": d["sent"],
 
 
96
  "question_id": d["question_id"],
97
+ "image_id": img_id,
98
+ "label": label,
99
  }