Skip to content

Commit 2c33a26

Browse files
Indraneil PaulIndraneil Paul
authored andcommitted
Remove unused imports and increase K values
1 parent 1c95f50 commit 2c33a26

File tree

6 files changed

+11
-213
lines changed

6 files changed

+11
-213
lines changed

wildcode/eval/utils.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,10 @@
2424
import faulthandler
2525
import io
2626
import os
27-
import sys
2827
import platform
2928
import signal
3029
import tempfile
3130
import subprocess
32-
import threading
3331
import multiprocessing
3432
from typing import Optional
3533

wildcode/evaluate.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,7 @@ def stucking_checker():
213213

214214
pass_at_k = {
215215
f"pass@{k}": estimate_pass_at_k(total, base_correct, k).mean()
216-
for k in [1, 5, 10]
216+
for k in [1, 5, 10, 25, 100]
217217
if total.min() >= k
218218
}
219219
cprint(f"{flags.dataset}", "green")

wildcode/gen/util/__init__.py

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,7 @@
11
import time
2-
import os
32
import sys
43
import types
54
import unittest
6-
import builtins
7-
8-
from copy import deepcopy
95

106
from wildcode.eval.utils import (
117
create_tempdir,
@@ -14,14 +10,16 @@
1410
time_limit,
1511
safe_environment,
1612
)
13+
14+
1715
def trusted_exec(code, test_code, task_id):
1816
"""Execute trusted code in place."""
19-
17+
2018
with create_tempdir():
2119
import os
2220
import shutil
2321
import builtins
24-
22+
2523
rmtree = shutil.rmtree
2624
rmdir = os.rmdir
2725
chdir = os.chdir
@@ -44,7 +42,8 @@ def trusted_exec(code, test_code, task_id):
4442
full_code = code + "\n" + test_code
4543

4644
# Compile and execute the combined code within the new module
47-
exec(compile(full_code, f"{module_name}.py", 'exec'), new_module.__dict__)
45+
exec(compile(full_code, f"{module_name}.py", 'exec'),
46+
new_module.__dict__)
4847
sys.modules[module_name] = new_module
4948
TestCases = getattr(new_module, 'TestCases')
5049
loader = unittest.TestLoader()
@@ -59,8 +58,10 @@ def trusted_exec(code, test_code, task_id):
5958
shutil.rmtree = rmtree
6059
os.rmdir = rmdir
6160
os.chdir = chdir
62-
assert len(test_result.failures+test_result.errors) == 0, f"{task_id} failed"
63-
61+
assert len(
62+
test_result.failures + test_result.errors
63+
) == 0, f"{task_id} failed with errors: {test_result.errors} and failures: {test_result.failures}"
64+
6465
return time.time() - start
6566

6667
def trusted_check_exec(code, inputs):

wildcode/inspect.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
from wildcode.data import get_wildcodebench
2-
import sys
32
import os
43
import shutil
54
import json

wildcode/lecacy_sanitize.py

Lines changed: 0 additions & 199 deletions
This file was deleted.

wildcode/sanitize.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
"""Post-processing LLM-generated Python code implemented using tree-sitter."""
22

33
import os
4-
import ast
54
import pathlib
65
from typing import Dict, Generator, List, Optional, Set, Tuple
76

0 commit comments

Comments
 (0)