Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/THUDM/AgentTuning
/ extract_answer
Function
extract_answer
eval_general/eval_gsm8k_tgi.py:141–146 ·
view source on GitHub ↗
(completion)
Source
from the content-addressed store, hash-verified
139
140
141
def
extract_answer(completion):
142
try
:
143
last_number = re.findall(r
'\d+'
, completion)[-1]
144
return
eval(last_number)
145
except
:
146
return
INVALID_ANS
147
148
149
def
is_correct(completion, answer):
Callers
1
is_correct
Function · 0.85
Calls
1
eval
Function · 0.85
Tested by
no test coverage detected