Spaces:
Sleeping
Sleeping
Update tools/FinalAnswerTool.py
Browse files- tools/FinalAnswerTool.py +4 -0
tools/FinalAnswerTool.py
CHANGED
|
@@ -17,6 +17,10 @@ class FinalAnswerTool(Tool):
|
|
| 17 |
output_type = "string"
|
| 18 |
|
| 19 |
def forward(self, answer: str) -> str:
|
|
|
|
|
|
|
|
|
|
|
|
|
| 20 |
match = re.search(r'boxed\{([^}]+)\}', answer)
|
| 21 |
if match:
|
| 22 |
answer = match.group(1)
|
|
|
|
| 17 |
output_type = "string"
|
| 18 |
|
| 19 |
def forward(self, answer: str) -> str:
|
| 20 |
+
if answer is None:
|
| 21 |
+
return "NA"
|
| 22 |
+
|
| 23 |
+
answer = str(answer)
|
| 24 |
match = re.search(r'boxed\{([^}]+)\}', answer)
|
| 25 |
if match:
|
| 26 |
answer = match.group(1)
|