zhimin-z commited on
Commit
4925ef7
·
1 Parent(s): c109720
Files changed (2) hide show
  1. app.py +3 -2
  2. msr.py +4 -4
app.py CHANGED
@@ -24,6 +24,7 @@ load_dotenv()
24
 
25
  AGENTS_REPO = "SWE-Arena/bot_metadata" # HuggingFace dataset for agent metadata
26
  LEADERBOARD_REPO = "SWE-Arena/leaderboard_metadata" # HuggingFace dataset for leaderboard data
 
27
 
28
  LEADERBOARD_COLUMNS = [
29
  ("Agent Name", "string"),
@@ -47,7 +48,7 @@ def is_rate_limit_error(e):
47
  @backoff.on_exception(
48
  backoff.expo,
49
  HfHubHTTPError,
50
- max_tries=5,
51
  base=300,
52
  max_value=3600,
53
  giveup=lambda e: not is_rate_limit_error(e),
@@ -63,7 +64,7 @@ def list_repo_files_with_backoff(api, **kwargs):
63
  @backoff.on_exception(
64
  backoff.expo,
65
  HfHubHTTPError,
66
- max_tries=5,
67
  base=300,
68
  max_value=3600,
69
  giveup=lambda e: not is_rate_limit_error(e),
 
24
 
25
  AGENTS_REPO = "SWE-Arena/bot_metadata" # HuggingFace dataset for agent metadata
26
  LEADERBOARD_REPO = "SWE-Arena/leaderboard_metadata" # HuggingFace dataset for leaderboard data
27
+ MAX_RETRIES = 5
28
 
29
  LEADERBOARD_COLUMNS = [
30
  ("Agent Name", "string"),
 
48
  @backoff.on_exception(
49
  backoff.expo,
50
  HfHubHTTPError,
51
+ max_tries=MAX_RETRIES,
52
  base=300,
53
  max_value=3600,
54
  giveup=lambda e: not is_rate_limit_error(e),
 
64
  @backoff.on_exception(
65
  backoff.expo,
66
  HfHubHTTPError,
67
+ max_tries=MAX_RETRIES,
68
  base=300,
69
  max_value=3600,
70
  giveup=lambda e: not is_rate_limit_error(e),
msr.py CHANGED
@@ -204,7 +204,7 @@ def is_retryable_error(e):
204
  @backoff.on_exception(
205
  backoff.expo,
206
  (HfHubHTTPError, requests.exceptions.Timeout, requests.exceptions.RequestException, Exception),
207
- max_tries=5,
208
  base=300,
209
  max_value=3600,
210
  giveup=lambda e: not is_retryable_error(e),
@@ -220,7 +220,7 @@ def list_repo_files_with_backoff(api, **kwargs):
220
  @backoff.on_exception(
221
  backoff.expo,
222
  (HfHubHTTPError, requests.exceptions.Timeout, requests.exceptions.RequestException, Exception),
223
- max_tries=5,
224
  base=300,
225
  max_value=3600,
226
  giveup=lambda e: not is_retryable_error(e),
@@ -236,7 +236,7 @@ def hf_hub_download_with_backoff(**kwargs):
236
  @backoff.on_exception(
237
  backoff.expo,
238
  (HfHubHTTPError, requests.exceptions.Timeout, requests.exceptions.RequestException, Exception),
239
- max_tries=5,
240
  base=300,
241
  max_value=3600,
242
  giveup=lambda e: not is_retryable_error(e),
@@ -252,7 +252,7 @@ def upload_file_with_backoff(api, **kwargs):
252
  @backoff.on_exception(
253
  backoff.expo,
254
  (HfHubHTTPError, requests.exceptions.Timeout, requests.exceptions.RequestException, Exception),
255
- max_tries=5,
256
  base=300,
257
  max_value=3600,
258
  giveup=lambda e: not is_retryable_error(e),
 
204
  @backoff.on_exception(
205
  backoff.expo,
206
  (HfHubHTTPError, requests.exceptions.Timeout, requests.exceptions.RequestException, Exception),
207
+ max_tries=MAX_RETRIES,
208
  base=300,
209
  max_value=3600,
210
  giveup=lambda e: not is_retryable_error(e),
 
220
  @backoff.on_exception(
221
  backoff.expo,
222
  (HfHubHTTPError, requests.exceptions.Timeout, requests.exceptions.RequestException, Exception),
223
+ max_tries=MAX_RETRIES,
224
  base=300,
225
  max_value=3600,
226
  giveup=lambda e: not is_retryable_error(e),
 
236
  @backoff.on_exception(
237
  backoff.expo,
238
  (HfHubHTTPError, requests.exceptions.Timeout, requests.exceptions.RequestException, Exception),
239
+ max_tries=MAX_RETRIES,
240
  base=300,
241
  max_value=3600,
242
  giveup=lambda e: not is_retryable_error(e),
 
252
  @backoff.on_exception(
253
  backoff.expo,
254
  (HfHubHTTPError, requests.exceptions.Timeout, requests.exceptions.RequestException, Exception),
255
+ max_tries=MAX_RETRIES,
256
  base=300,
257
  max_value=3600,
258
  giveup=lambda e: not is_retryable_error(e),