Skip to content

Commit

Permalink
Bug Fix (open-compass#26)
Browse files Browse the repository at this point in the history
  • Loading branch information
kennymckormick authored Dec 25, 2023
1 parent 3196807 commit 2a75d53
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
5 changes: 5 additions & 0 deletions vlmeval/eval/multiple_choice.py
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,11 @@ def multiple_choice_eval(eval_file, dataset=None, model='chatgpt-0613', nproc=4,
elif dataset == 'MMBench_TEST_EN':
dataset = 'MMBench'

if listinstr(['mmbench', 'ccbench'], dataset.lower()):
data = load(eval_file)
data['index'] = [int(x) for x in data['index']]
dump(data, eval_file)

rd.seed(2680)
suffix = eval_file.split('.')[-1]
assert model in ['chatgpt-0613', "exact_matching"]
Expand Down
4 changes: 3 additions & 1 deletion vlmeval/utils/dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,9 @@ def __init__(self, dataset='MMBench', img_root=None):
data['image_path'] = [
eval(pths) if isliststr(pths) else pths for pths in data['image_path']
]

if np.all([istype(x, int) for x in data['index']]):
data['index'] = [int(x) for x in data['index']]

self.data = data

img_root = img_root if img_root is not None else osp.join('images', img_root_map[dataset])
Expand Down

0 comments on commit 2a75d53

Please sign in to comment.