File tree 2 files changed +9
-3
lines changed
2 files changed +9
-3
lines changed Original file line number Diff line number Diff line change @@ -90,8 +90,8 @@ def evaluate_generation(
90
90
template = CritiqueTaskTemplate (
91
91
name = "vhelm_gpt4v_originality" ,
92
92
# TODO: Add proper instructions
93
- instructions = "Answer the question given the text and image, remember to only answer "
94
- "with a capital letter .\n \n {{prompt}}" ,
93
+ instructions = "Answer the multiple choice question by just giving the letter of the correct "
94
+ "answer .\n \n {{prompt}}" ,
95
95
num_respondents = self ._num_respondents ,
96
96
questions = [
97
97
CritiqueQuestionTemplate (
Original file line number Diff line number Diff line change @@ -135,7 +135,13 @@ def _multiple_choice_completion_to_answer(
135
135
raise CritiqueParseError (
136
136
f"Invalid answer: { completion } . Multiple choice questions should have one answer."
137
137
)
138
- return answers [0 ]
138
+ letter_answer = answers [0 ]
139
+ choice_rank = string .ascii_uppercase .index (letter_answer )
140
+ if choice_rank >= len (question .options ):
141
+ raise CritiqueParseError (
142
+ f"Invalid answer: { completion } . The answer is out of range of the options: { question .options } "
143
+ )
144
+ return letter_answer
139
145
except CritiqueParseError as e :
140
146
# If there was an error parsing the answer, we assume the user did not answer the question.
141
147
hlog (f"Error parsing answer: { e } . Skipping question (and so the respondent entirely)" )
You can’t perform that action at this time.
0 commit comments