MCPcopy
hub / github.com/open-compass/VLMEvalKit / MMMU_result_transfer

Function MMMU_result_transfer

vlmeval/utils/result_transfer.py:8–28  ·  view source on GitHub ↗
(result_path)

Source from the content-addressed store, hash-verified

6
7
8def MMMU_result_transfer(result_path):
9 res = {}
10 result_data = load(result_path)
11 mcq = result_data['A'].notna()
12 lt = len(result_data)
13 for i in range(lt):
14 line = result_data.iloc[i]
15 if mcq[i]:
16 options = {
17 cand: line[cand]
18 for cand in string.ascii_uppercase
19 if cand in line and not pd.isna(line[cand])
20 }
21 prediction = line['prediction']
22 infer_prediction = can_infer(prediction, options)
23 res[line['id']] = infer_prediction
24 else:
25 res[line['id']] = line['prediction']
26 result_json = result_path.replace('.xlsx', '.json')
27 dump(res, result_json)
28 return result_json
29
30
31def MMTBench_result_transfer(eval_file, dataset='default', **judge_kwargs):

Callers 1

mainFunction · 0.90

Calls 3

loadFunction · 0.85
can_inferFunction · 0.85
dumpFunction · 0.85

Tested by

no test coverage detected