Skip to content

Commit

Permalink
[Fix]: Fix bug
Browse files Browse the repository at this point in the history
  • Loading branch information
YuanLiuuuuuu committed May 22, 2023
1 parent 1537d46 commit b0ad99a
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions mmpretrain/evaluation/metrics/scienceqa.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,13 +83,13 @@ def process(self, data_batch, data_samples) -> None:
data_sample.get('pred_answer'), choices, self.options)
result['grade'] = data_sample.get('grade')
result['subject'] = data_sample.get('subject')
result['answer'] = self.options[data_sample.get('answer')]
image = data_sample.get('image')
result['answer'] = self.options[data_sample.get('gt_answer')]
hint = data_sample.get('hint')
has_image = data_sample.get('has_image', False)
result[
'no_context'] = True if image is None and hint is None else False # noqa
'no_context'] = True if not has_image and hint is None else False # noqa
result['has_text'] = True if hint is not None else False
result['has_image'] = data_sample.get('has_image', False)
result['has_image'] = has_image

# Save the result to `self.results`.
self.results.append(result)
Expand Down

0 comments on commit b0ad99a

Please sign in to comment.