This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import tqdm | |
| import numpy as np | |
| import torch | |
| import torch.distributed as dist | |
| import transformers | |
| def extract_xml_answer(text: str) -> str: | |
| answer = text.split("<final_answer>")[-1] | |
| answer = answer.split("</final_answer>")[0] | |
| return answer.strip() |