MCPcopy Index your code
hub / github.com/evalplus/evalplus / make_cache

Function make_cache

evalplus/data/utils.py:27–45  ·  view source on GitHub ↗
(gzip_url, cache_path)

Source from the content-addressed store, hash-verified

25
26
27def make_cache(gzip_url, cache_path):
28 # Check if human eval file exists in CACHE_DIR
29 if not os.path.exists(cache_path):
30 # Install HumanEval dataset and parse as jsonl
31 print(f"Downloading dataset from {gzip_url}")
32 with tempdir.TempDir() as tmpdir:
33 plus_gz_path = os.path.join(tmpdir, f"data.jsonl.gz")
34 wget.download(gzip_url, plus_gz_path)
35
36 with gzip.open(plus_gz_path, "rb") as f:
37 plus = f.read().decode("utf-8")
38
39 # create CACHE_DIR if not exists
40 if not os.path.exists(CACHE_DIR):
41 os.makedirs(CACHE_DIR)
42
43 # Write the original human eval file to CACHE_DIR
44 with open(cache_path, "w") as f:
45 f.write(plus)
46
47
48def write_jsonl(

Callers 3

get_human_evalFunction · 0.90
_ready_mbpp_plus_pathFunction · 0.90

Calls 1

readMethod · 0.80

Tested by

no test coverage detected