Sborole commited on
Commit
ec0eab0
·
verified ·
1 Parent(s): 70131d7

Update tools/FinalAnswerTool.py

Browse files
Files changed (1) hide show
  1. 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)