(text)
| 72 | return INVALID_ANS |
| 73 | |
| 74 | def extract_answer(text): |
| 75 | if prefix_sky1 in text: |
| 76 | text = text.split(prefix_sky1)[-1] |
| 77 | if prefix_sky2 in text: |
| 78 | text = text.split(prefix_sky2)[-1] |
| 79 | match1 = re.findall(ans_re1, text) |
| 80 | match2 = re.findall(ans_re2, text) |
| 81 | ans = [] |
| 82 | if match1: |
| 83 | match_str1 = get_match_str(match1, -1) |
| 84 | ans.append(match_str1) |
| 85 | if match2: |
| 86 | match_str2 = get_match_str(match2, -1).replace('$','') |
| 87 | ans.append(match_str2) |
| 88 | if len(ans) > 0: |
| 89 | return eval(ans[-1]) |
| 90 | else: |
| 91 | return INVALID_ANS |
| 92 | |
| 93 | def is_correct(completion, answer): |
| 94 | completion = completion.split('</s>')[0] |
no test coverage detected