MCPcopy
hub / github.com/microsoft/agent-lightning / load_math_dataset

Function load_math_dataset

examples/unsloth/math_agent.py:69–82  ·  view source on GitHub ↗

Load the GSM-hard math dataset from the local JSONL file. Args: limit: Optional maximum number of problems to load. If None, loads all problems. Returns: A list of GsmProblem instances.

(limit: Optional[int] = None)

Source from the content-addressed store, hash-verified

67
68
69def load_math_dataset(limit: Optional[int] = None) -> Dataset[GsmProblem]:
70 """Load the GSM-hard math dataset from the local JSONL file.
71
72 Args:
73 limit: Optional maximum number of problems to load. If None, loads all problems.
74
75 Returns:
76 A list of GsmProblem instances.
77 """
78 with open("data_gsmhard.jsonl", "r") as f:
79 problems = [GsmProblem(**json.loads(line)) for line in f]
80 if limit is not None:
81 problems = problems[:limit]
82 return problems
83
84
85@rollout

Callers 3

sft_algorithmFunction · 0.90
sft_allinone.pyFile · 0.90
math_agent_dry_runFunction · 0.85

Calls 1

GsmProblemClass · 0.85

Tested by

no test coverage detected