Skip to content

Commit 69d2e42

Browse files
committed
fix: add extra name in save ppath
1 parent 52a9382 commit 69d2e42

File tree

3 files changed

+12
-13
lines changed

3 files changed

+12
-13
lines changed

bigcodebench/data/bigcodebench.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -27,13 +27,13 @@ def _ready_bigcodebench_path(subset="full", version="default") -> str:
2727

2828
extra = "-" + subset if subset else ""
2929

30-
try:
31-
dataset = load_dataset(BIGCODEBENCH_HF+extra, split=BIGCODEBENCH_VERSION)
32-
make_cache(url, dataset, path)
33-
except:
34-
if os.path.exists(path):
35-
os.remove(path)
36-
make_cache(url, None, path, gh=True)
30+
# try:
31+
dataset = load_dataset(BIGCODEBENCH_HF+extra, split=BIGCODEBENCH_VERSION)
32+
make_cache(url, dataset, path)
33+
# except:
34+
# if os.path.exists(path):
35+
# os.remove(path)
36+
# make_cache(url, None, path, gh=True)
3737

3838
return path
3939

bigcodebench/data/utils.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,8 @@ 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 not os.path.exists(cache_path):
24-
25-
if gh:
23+
if gh:
24+
if not os.path.exists(cache_path):
2625
# Install BigCodeBench dataset and parse as jsonl
2726
print(f"Downloading dataset from {gzip_url}")
2827
with tempdir.TempDir() as tmpdir:
@@ -39,8 +38,8 @@ def make_cache(gzip_url, hf_data, cache_path, gh=False):
3938
# Write the original open eval file to CACHE_DIR
4039
with open(cache_path, "w") as f:
4140
f.write(data)
42-
else:
43-
hf_data.to_json(cache_path)
41+
else:
42+
hf_data.to_json(cache_path)
4443

4544

4645
def write_jsonl(

bigcodebench/generate.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ def main():
148148

149149
extra = "-" + args.subset if args.subset else ""
150150
if not args.save_path:
151-
save_path = args.model.replace("/", "--") + f"--bigcodebench-{args.split}--{args.backend}-{args.temperature}-{args.n_samples}.jsonl"
151+
save_path = args.model.replace("/", "--") + f"--bigcodebench{extra}-{args.split}--{args.backend}-{args.temperature}-{args.n_samples}.jsonl"
152152
else:
153153
save_path = args.save_path
154154

0 commit comments

Comments
 (0)