Skip to content

Commit fc759a2

Browse files
committed
fix: avoid duplicated save
1 parent 02b396a commit fc759a2

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

bigcodebench/data/utils.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,9 @@ def get_dataset_metadata(version: str, subset: str="full"):
2020

2121
def make_cache(gzip_url, hf_data, cache_path, gh=False):
2222
# Check if open eval file exists in CACHE_DIR
23-
if gh:
24-
if not os.path.exists(cache_path):
23+
24+
if not os.path.exists(cache_path):
25+
if gh:
2526
# Install BigCodeBench dataset and parse as jsonl
2627
print(f"Downloading dataset from {gzip_url}")
2728
with tempdir.TempDir() as tmpdir:
@@ -38,8 +39,8 @@ def make_cache(gzip_url, hf_data, cache_path, gh=False):
3839
# Write the original open eval file to CACHE_DIR
3940
with open(cache_path, "w") as f:
4041
f.write(data)
41-
else:
42-
hf_data.to_json(cache_path)
42+
else:
43+
hf_data.to_json(cache_path)
4344

4445

4546
def write_jsonl(

0 commit comments

Comments
 (0)