Skip to content

Commit c355738

Browse files
committed
fix: resolve constant conflict
1 parent 3e543ec commit c355738

File tree

4 files changed

+9
-9
lines changed

4 files changed

+9
-9
lines changed

bigcodebench/eval/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
swallow_io,
4242
time_limit,
4343
safe_environment,
44-
TIMEOUT,
44+
TIMEOUT_LIMIT,
4545
)
4646

4747

@@ -179,7 +179,7 @@ def untrusted_check(
179179
gt_time_limit: float = 60
180180
) -> Tuple[str, np.ndarray]:
181181
time_limit = max(min_time_limit, gt_time_limit)
182-
timeout = max(os.getenv("BIGCODEBENCH_TIMEOUT_PER_TASK", TIMEOUT), time_limit) + 1
182+
timeout = max(os.getenv("BIGCODEBENCH_TIMEOUT_PER_TASK", TIMEOUT_LIMIT), time_limit) + 1
183183
# shared memory objects
184184
stat = Value("i", _UNKNOWN)
185185
manager = Manager()

bigcodebench/eval/utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
import multiprocessing
3232
from typing import Optional
3333

34-
TIMEOUT=240.0
34+
TIMEOUT_LIMIT=240.0
3535

3636
@contextlib.contextmanager
3737
def swallow_subprocess_output():

bigcodebench/gen/util/__init__.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
swallow_io,
1212
time_limit,
1313
safe_environment,
14-
TIMEOUT,
14+
TIMEOUT_LIMIT,
1515
)
1616

1717

@@ -52,7 +52,7 @@ def trusted_exec(code, test_code, task_id, max_as_limit, max_data_limit, max_sta
5252
suite = loader.loadTestsFromTestCase(TestCases)
5353
test_result = unittest.TestResult()
5454
start = time.time()
55-
with safe_environment(), swallow_io(), time_limit(seconds=TIMEOUT):
55+
with safe_environment(), swallow_io(), time_limit(seconds=TIMEOUT_LIMIT):
5656
suite.run(test_result)
5757

5858
if len(test_result.failures + test_result.errors) > 0:
@@ -69,7 +69,7 @@ def trusted_exec(code, test_code, task_id, max_as_limit, max_data_limit, max_sta
6969
def trusted_check_exec(code, inputs):
7070
"""Check trusted_exec success."""
7171
try:
72-
with time_limit(seconds=TIMEOUT):
72+
with time_limit(seconds=TIMEOUT_LIMIT):
7373
trusted_exec(code, inputs)
7474
except Exception:
7575
return False
@@ -84,7 +84,7 @@ def trusted_check(
8484
max_data_limit: float,
8585
max_stack_limit: float,
8686
):
87-
timeout = os.getenv("BIGCODEBENCH_TIMEOUT_PER_TASK", TIMEOUT) + 1
87+
timeout = os.getenv("BIGCODEBENCH_TIMEOUT_PER_TASK", TIMEOUT_LIMIT) + 1
8888
# shared memory objects
8989
times = Value("d", -1)
9090
manager = Manager()

bigcodebench/gen/util/openai_request.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,8 @@ def make_request(
2929
],
3030
max_tokens=max_tokens,
3131
temperature=temperature,
32-
n=n,
33-
**kwargs
32+
# n=n,
33+
# **kwargs
3434
)
3535

3636

0 commit comments

Comments
 (0)