MCPcopy
hub / github.com/z-lab/dflash / load_and_process_dataset

Function load_and_process_dataset

dflash/benchmark.py:84–93  ·  view source on GitHub ↗
(data_name: str)

Source from the content-addressed store, hash-verified

82
83
84def load_and_process_dataset(data_name: str) -> list[dict]:
85 if data_name not in DATASETS:
86 raise ValueError(f"Unknown dataset '{data_name}'. Available: {list(DATASETS.keys())}")
87
88 path = CACHE_DIR / f"{data_name}.jsonl"
89 if not path.exists():
90 _prepare_dataset(data_name)
91
92 with open(path) as f:
93 return [json.loads(line) for line in f]
94
95
96def _limit_dataset(dataset: list[dict], max_samples: int | None) -> list[dict]:

Callers 3

_run_transformersFunction · 0.85
_run_mlxFunction · 0.85
_run_serverFunction · 0.85

Calls 1

_prepare_datasetFunction · 0.85

Tested by

no test coverage detected