MCPcopy Create free account
hub / github.com/ScaleML/AgentSPEX / _load_existing_results

Function _load_existing_results

src/benchmarks/aime/run.py:15–35  ·  view source on GitHub ↗

Load completed results from a previous run.

(output_dir: Path)

Source from the content-addressed store, hash-verified

13
14
15def _load_existing_results(output_dir: Path) -> Dict[str, AIMEResult]:
16 """Load completed results from a previous run."""
17 existing = {}
18 for json_path in output_dir.glob("*.json"):
19 try:
20 with json_path.open("r") as f:
21 data = json.load(f)
22 if data.get("status") == "completed":
23 existing[data["problem_id"]] = AIMEResult(
24 problem_id=data["problem_id"],
25 problem=data.get("problem", ""),
26 correct_answer=data.get("correct_answer", ""),
27 dataset=data.get("dataset", ""),
28 status="completed",
29 response=data.get("response", ""),
30 parsed_answer=data.get("parsed_answer"),
31 is_correct=data.get("is_correct", False),
32 )
33 except (json.JSONDecodeError, KeyError):
34 continue
35 return existing
36
37
38def _load_problems(dataset="all", problem_ids=None, limit=None) -> List[dict]:

Callers 1

mainFunction · 0.85

Calls 2

AIMEResultClass · 0.90
getMethod · 0.80

Tested by

no test coverage detected