mirror of
https://github.com/OpenBMB/MiniCPM-V.git
synced 2026-02-05 18:29:18 +08:00
Modify eval_mm for MiniCPM-o 2.6
This commit is contained in:
13
eval_mm/vlmevalkit/vlmeval/dataset/utils/crpe.py
Normal file
13
eval_mm/vlmevalkit/vlmeval/dataset/utils/crpe.py
Normal file
@@ -0,0 +1,13 @@
|
||||
import json
|
||||
import argparse
|
||||
from collections import defaultdict
|
||||
|
||||
|
||||
def is_correct(predict, answer):
|
||||
# predict是标准答案 answer是预测
|
||||
if len(answer) == 1:
|
||||
return answer[0] == predict[0]
|
||||
elif len(answer) != 1 and answer[0] in ['A', 'B', 'C', 'D']:
|
||||
return answer[0] == predict[0]
|
||||
elif len(answer) != 1 and answer[0] not in ['A', 'B', 'C', 'D']:
|
||||
return predict[4:].lower() in answer.lower()
|
||||
Reference in New Issue
Block a user