MCPcopy Create free account
hub / github.com/FlashSampling/FlashSampling / extract_reference

Function extract_reference

benchmarking/vllm/judge_eval.py:281–286  ·  view source on GitHub ↗

Extract the final numeric answer after '#### ' in the GSM8K answer string.

(doc_answer: str)

Source from the content-addressed store, hash-verified

279
280
281def extract_reference(doc_answer: str) -> str:
282 """Extract the final numeric answer after '#### ' in the GSM8K answer string."""
283 match = re.search(r"####\s*(.+)$", doc_answer)
284 if match:
285 return match.group(1).strip()
286 return doc_answer.strip()
287
288
289def parse_args():

Callers 1

judge_dirFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected