Skip to content

Commit

Permalink
add necessary comments
Browse files Browse the repository at this point in the history
  • Loading branch information
Luodian committed Sep 11, 2023
1 parent ac0cfcd commit 4bd8064
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
1 change: 0 additions & 1 deletion pipeline/evaluation/datasets/mmbench.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ def decode_base64_to_image(base64_string):
class MMBenchDataset(Dataset):
def __init__(self, data_file, sys_prompt="There are several options:"):
self.df = pd.read_csv(data_file, sep="\t")
# self.pipeline = Compose(pipeline)
self.sys_prompt = sys_prompt

def __len__(self):
Expand Down
5 changes: 4 additions & 1 deletion pipeline/evaluation/evaluate.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@


from pipeline.evaluation.evaluator.mmbench import MMBenchEvaluator

from pipeline.evaluation.models.idefics import Idefics


Expand All @@ -13,3 +12,7 @@
evaluator = MMBenchEvaluator("/data/pufanyi/training_data/MMBench/mmbench_test_20230712.tsv")
model = Idefics("/data/pufanyi/training_data/checkpoints/idefics-9b-instruct")
evaluator.evaluate(model)

# pip install otter_ai
# other necessary packages
# python -m otter_ai.eval --models=Otter --model_path=luodian/OTTER-Image-MPT --dataset=MMBench
4 changes: 4 additions & 0 deletions pipeline/evaluation/evaluator/mmbench.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,10 @@ def __init__(self, data_file, sys_prompt="There are several options:"):
)

def evaluate(self, model, output_file=None):
# inside this function
# MMBench: generate a csv file with columns: index, prediction, xxx
# MME: generate the final score (probably should load the gt file) and print it out
# SeedBench: generate the final score (probably should load the gt file) and print it out
if output_file is None:
output_file = self.default_output_file

Expand Down

0 comments on commit 4bd8064

Please sign in to comment.