prompt=question+'\nAnswer this question in detail.'
eliflistinstr(['MMVet'],dataset):
prompt=line['question']
else:
question=line['question']
prompt=question+'\nAnswer the question using a single word or phrase.'
elifdatasetisnotNoneand'MMMU'indataset:
question=line['question']
options={
cand:line[cand]
forcandinstring.ascii_uppercase
ifcandinlineandnotpd.isna(line[cand])
}
forkey,iteminoptions.items():
question+=f'\n{key}. {item}'
prompt={
'multiple-choice':'You are an expert in {}. Please solve the university-level {} examination question, which includes interleaved images and text. Your output should be divided into two parts: First, reason about the correct answer. Then write the answer in the following format where X is exactly one of the choices given by the problem: "ANSWER: X". If you are uncertain of the correct answer, guess the most likely one.',# noqa: E501
'open':'You are an expert in {}. Please solve the university-level {} examination question, which includes interleaved images and text. Your output should be divided into two parts: First, reason about the correct answer. Then write the answer in the following format where X is only the answer and nothing else: "ANSWER: X"'# noqa: E501
LLAVA_V1_7B_MODEL_PTH='Please set your local path to LLaVA-7B-v1.1 here, the model weight is obtained by merging LLaVA delta weight based on vicuna-7b-v1.1 in https://github.com/haotian-liu/LLaVA/blob/main/docs/MODEL_ZOO.md with vicuna-7b-v1.1. '