(completion)
| 10 | ANSWER_TRIGGER = "The answer is" |
| 11 | |
| 12 | def extract_answer_from_output(completion): |
| 13 | match = ANS_RE.search(completion) |
| 14 | if match: |
| 15 | match_str = match.group(1).strip() |
| 16 | match_str = match_str.replace(",", "") |
| 17 | return match_str |
| 18 | else: |
| 19 | return INVALID_ANS |
| 20 | |
| 21 | def is_correct(model_answer, answer): |
| 22 | gt_answer = extract_answer_from_output(answer) |