Skip to content

Commit b73221c

Browse files
committed
Refine code format
1 parent a90b5d6 commit b73221c

File tree

1 file changed

+3
-10
lines changed

1 file changed

+3
-10
lines changed

bigcode_eval/tasks/custom_metrics/beyond_eval.py

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
# https://github.com/openai/human-eval/blob/master/human_eval/execution.py
66

77
from concurrent.futures import ThreadPoolExecutor, as_completed
8-
from typing import Optional, Dict, Any, List
98
from multiprocessing import Manager, Process
9+
from typing import Optional, Dict
1010
from tqdm import tqdm
1111
import numpy as np
1212
import faulthandler
@@ -19,6 +19,7 @@
1919
import time
2020
import os
2121
import io
22+
2223
CITATION = """
2324
@article{du2024mercury,
2425
title={Mercury: An Efficiency Benchmark for LLM Code Synthesis},
@@ -28,7 +29,6 @@
2829
}
2930
"""
3031

31-
3232
# Timeout Exception
3333
class TimeoutException(Exception):
3434
""" Raise for TimeoutException """
@@ -56,7 +56,6 @@ def readable(self, *args, **kwargs):
5656
""" Returns True if the IO object can be read. """
5757
return False
5858

59-
6059
class Sandbox(object):
6160
@staticmethod
6261
@contextlib.contextmanager
@@ -392,8 +391,7 @@ def compute_beyond_eval(generations_list, reference_list, timeout=10):
392391
"timeout": timeout,
393392
}
394393

395-
results = [sandbox.run_sample(sample) for _ in range(3)]
396-
print(results[0])
394+
results = [sandbox.run_sample(sample) for _ in range(5)]
397395
t_c += 1
398396

399397
# Calculate Beyond
@@ -418,11 +416,6 @@ def compute_beyond_eval(generations_list, reference_list, timeout=10):
418416
scores['Average']['correct_c'] += [p_c]
419417
scores['Average']['beyond_c'] += [b_l]
420418

421-
# print(f'total: {t_c}')
422-
# print(f'correct: {p_c}')
423-
# print(f'beyond: {b_l}')
424-
# print("-" * 60)
425-
426419
results = dict()
427420
for difficulty in ['Easy', "Medium", "Hard", "Average"]:
428421
total = np.array(scores[difficulty]['total_c'])

0 commit comments

Comments
 (0)