Skip to content

Commit b9a7b17

Browse files
committed
feat(evaluate): add backoff for concurrent issues
1 parent b888ce6 commit b9a7b17

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

bigcodebench/evaluate.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
import time
88
from collections import Counter, defaultdict
99
from concurrent.futures import ProcessPoolExecutor, as_completed, wait, FIRST_COMPLETED
10+
from concurrent.futures._base import CancelledError
1011
from datetime import datetime
1112
from typing import Any, Dict, List, Tuple, Optional
1213
from warnings import warn
@@ -168,7 +169,7 @@ def evaluate(
168169
api_name="/predict"
169170
)
170171
break
171-
except httpx.ReadTimeout:
172+
except (httpx.ReadTimeout, CancelledError):
172173
print("Read timeout error. Retrying in 4s...")
173174
time.sleep(4)
174175
gt_pass_rate = pass_at_k["gt_pass_rate"]

0 commit comments

Comments
 (0)