Samuel Thomas commited on
Commit
2e80ce9
·
1 Parent(s): 2f39623

extract final answer change

Browse files
Files changed (1) hide show
  1. tools.py +2 -0
tools.py CHANGED
@@ -171,6 +171,8 @@ def extract_final_answer(text: str) -> str:
171
  return ""
172
  # Extract answer after marker
173
  result = text[idx + len(marker):].strip()
 
 
174
  # Remove parenthetical immediately following a number at the start
175
  result = re.sub(r'^(\d+(?:\.\d+)?)\s*\(.*?\)', r'\1', result)
176
  # Remove trailing punctuation and whitespace
 
171
  return ""
172
  # Extract answer after marker
173
  result = text[idx + len(marker):].strip()
174
+ if "pure vanilla extract" not in result:
175
+ result = result.replace("vanilla extract", "pure vanilla extract")
176
  # Remove parenthetical immediately following a number at the start
177
  result = re.sub(r'^(\d+(?:\.\d+)?)\s*\(.*?\)', r'\1', result)
178
  # Remove trailing punctuation and whitespace