(text: str)
| 172 | |
| 173 | @TEXT_POSTPROCESSORS.register_module('math_postprocess') |
| 174 | def math_postprocess(text: str) -> str: |
| 175 | |
| 176 | for maybe_ans in text.split('.'): |
| 177 | if 'final answer' in maybe_ans.lower(): |
| 178 | return normalize_final_answer(maybe_ans) |
| 179 | return normalize_final_answer(text.split('.')[0]) |
| 180 | # return normalize_final_answer( |
| 181 | # text.split('Final Answer: ', 1)[-1].split('\n\n')[0]) |
| 182 | |
| 183 | |
| 184 | @TEXT_POSTPROCESSORS.register_module('math_judement_preprocess') |
nothing calls this directly
no test coverage detected