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

Function _ensure_data

src/benchmarks/writing_bench/run.py:55–72  ·  view source on GitHub ↗

Download benchmark data from GitHub if not already present.

()

Source from the content-addressed store, hash-verified

53
54
55def _ensure_data():
56 """Download benchmark data from GitHub if not already present."""
57 _DATA_DIR.mkdir(parents=True, exist_ok=True)
58
59 if not _BENCHMARK_PATH.exists():
60 print("Downloading WritingBench benchmark data...")
61 url = f"{_GITHUB_RAW_BASE}/benchmark_all.jsonl"
62 if not _download_file(url, _BENCHMARK_PATH):
63 print("ERROR: Could not download benchmark_all.jsonl. Exiting.")
64 sys.exit(1)
65 print(f" Saved to {_BENCHMARK_PATH}")
66
67 # Download requirement subset files (optional, for detailed scoring)
68 for rel_path in _REQUIREMENT_FILES:
69 dest = _DATA_DIR / rel_path
70 if not dest.exists():
71 url = f"{_GITHUB_RAW_BASE}/{rel_path}"
72 _download_file(url, dest)
73
74
75def _load_queries(query_indices=None, limit=None) -> List[dict]:

Callers 1

mainFunction · 0.85

Calls 1

_download_fileFunction · 0.85

Tested by

no test coverage detected