File size: 590 Bytes
586da84
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
"""Reference prompt builders for the normalized release and legacy experiments."""
def build_prompt(sample, legacy=False):
    choices=sample['choices']
    letters=', '.join(c['label'] for c in choices)
    question=sample['question_raw'] if legacy else sample['question']
    return (
        'Please answer the following multiple-choice question based on the image.\n'
        f'You must output only one uppercase letter from: {letters}. Do not output anything else.\n'
        f'Question: {question}\nOptions:\n'
        + '\n'.join(f"{c['label']}. {c['text']}" for c in choices)
    )