Skip to content

Commit 99bcd21

Browse files
SJTUyhSJTUyh
andauthored
[bugfix] Fix mbpp evaluater class missing logger (#115)
* auto label * fix mbpp pass@k * fix mbpp pass@k * fix mbpp pass@k * fix mbpp pass@k * fix mbpp pass@k --------- Co-authored-by: SJTUyh <yh_silence@alumni.sjtu.edu.cn>
1 parent 83416c7 commit 99bcd21

2 files changed

Lines changed: 7 additions & 6 deletions

File tree

.github/workflows/run-ut-on-pr-py.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ env:
1717
PY310_VERSION: 3.10.12
1818
jobs:
1919
pr_run_test:
20-
runs-on: [self-hosted, Linux]
20+
runs-on: [self-hosted, Linux, run]
2121
timeout-minutes: 20
2222
steps:
2323
- name: Checkout code

ais_bench/benchmark/datasets/mbpp.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,7 @@ def __init__(self, metric: str = 'MBPP') -> None:
225225
DSET_CODES.INVALID_MBPP_METRIC,
226226
f"MBPP evaluator metric must be 'MBPP' or 'MBPPPlus', got '{self.metric}'"
227227
)
228-
super.__init__()
228+
super().__init__()
229229

230230
def score(self, predictions, references):
231231
if len(predictions) != len(references):
@@ -397,13 +397,13 @@ def _execution(programs, timeout):
397397
exec(programs, exec_globals)
398398
key.append('pass')
399399
except TimeOutException:
400-
logger.debug(f"Program execution timeout for index {index}")
400+
logger.debug(f"Program execution timeout for task_id {task_id}")
401401
key.append('timeout')
402402
except AssertionError as e:
403-
logger.debug(f"Program assertion failed for index {index}: {e}")
403+
logger.debug(f"Program assertion failed for task_id {task_id}: {e}")
404404
key.append('wrong_answer')
405405
except BaseException as e:
406-
logger.debug(f"Program execution failed for index {index}: {e}")
406+
logger.debug(f"Program execution failed for task_id {task_id}: {e}")
407407
key.append('failed')
408408

409409
manager = multiprocessing.Manager()
@@ -428,10 +428,11 @@ class MBPPPassKEvaluator(MBPPEvaluator):
428428
k(Tuple[int]): Choices of Pass@k. Defaults to (1, 10, 100)
429429
"""
430430

431-
def __init__(self, k=(1, 10, 100)) -> None:
431+
def __init__(self, k=(1, 10, 100), metric: str = 'MBPP') -> None:
432432
if not isinstance(k, Sequence):
433433
k = (k, )
434434
self.k = k
435+
super().__init__(metric=metric)
435436

436437
@staticmethod
437438
def estimate_pass_at_k(

0 commit comments

Comments
 (0)