Skip to content

Commit 365867c

Browse files
authored
Merge pull request #86 from hvaara/re-progress-checker-fix
Reintroduce progress checker from #48
2 parents 98482fd + 45e901f commit 365867c

File tree

1 file changed

+7
-8
lines changed

1 file changed

+7
-8
lines changed

bigcodebench/evaluate.py

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -322,14 +322,13 @@ def evaluate(
322322
assert len(completion_id) == len(problems), f"Missing problems in samples. Expected {len(problems)} problems, got {len(completion_id)}"
323323

324324
def stucking_checker():
325-
while remainings:
326-
last_size = len(remainings)
327-
time.sleep(240)
328-
if last_size != len(remainings) or len(remainings) == 0:
329-
continue
330-
# Potential stucking
331-
warn("No samples had finished testing in the last 240s")
332-
warn(f"{len(remainings)} samples to be tested: {remainings}")
325+
not_done = futures
326+
while len(not_done) > 0:
327+
done, not_done = wait(not_done, timeout=240, return_when=FIRST_COMPLETED)
328+
329+
if len(done) == 0:
330+
warn("No samples have finished testing in the last 240s")
331+
warn(f"{len(remainings)} samples to be tested: {remainings}")
333332

334333
threading.Thread(target=stucking_checker).start()
335334

0 commit comments

Comments
 (0)