zhimin-z commited on
Commit
50f1e3f
·
1 Parent(s): b75364c
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
@@ -203,7 +203,7 @@ def is_retryable_error(e):
203
  @backoff.on_exception(
204
  backoff.expo,
205
  (HfHubHTTPError, requests.exceptions.Timeout, requests.exceptions.RequestException, Exception),
206
- max_tries=5,
207
  base=300,
208
  max_value=3600,
209
  giveup=lambda e: not is_retryable_error(e),
@@ -219,7 +219,7 @@ def list_repo_files_with_backoff(api, **kwargs):
219
  @backoff.on_exception(
220
  backoff.expo,
221
  (HfHubHTTPError, requests.exceptions.Timeout, requests.exceptions.RequestException, Exception),
222
- max_tries=5,
223
  base=300,
224
  max_value=3600,
225
  giveup=lambda e: not is_retryable_error(e),
@@ -235,7 +235,7 @@ def hf_hub_download_with_backoff(**kwargs):
235
  @backoff.on_exception(
236
  backoff.expo,
237
  (HfHubHTTPError, requests.exceptions.Timeout, requests.exceptions.RequestException, Exception),
238
- max_tries=5,
239
  base=300,
240
  max_value=3600,
241
  giveup=lambda e: not is_retryable_error(e),
@@ -251,7 +251,7 @@ def upload_file_with_backoff(api, **kwargs):
251
  @backoff.on_exception(
252
  backoff.expo,
253
  (HfHubHTTPError, requests.exceptions.Timeout, requests.exceptions.RequestException, Exception),
254
- max_tries=5,
255
  base=300,
256
  max_value=3600,
257
  giveup=lambda e: not is_retryable_error(e),
 
203
  @backoff.on_exception(
204
  backoff.expo,
205
  (HfHubHTTPError, requests.exceptions.Timeout, requests.exceptions.RequestException, Exception),
206
+ max_tries=MAX_RETRIES,
207
  base=300,
208
  max_value=3600,
209
  giveup=lambda e: not is_retryable_error(e),
 
219
  @backoff.on_exception(
220
  backoff.expo,
221
  (HfHubHTTPError, requests.exceptions.Timeout, requests.exceptions.RequestException, Exception),
222
+ max_tries=MAX_RETRIES,
223
  base=300,
224
  max_value=3600,
225
  giveup=lambda e: not is_retryable_error(e),
 
235
  @backoff.on_exception(
236
  backoff.expo,
237
  (HfHubHTTPError, requests.exceptions.Timeout, requests.exceptions.RequestException, Exception),
238
+ max_tries=MAX_RETRIES,
239
  base=300,
240
  max_value=3600,
241
  giveup=lambda e: not is_retryable_error(e),
 
251
  @backoff.on_exception(
252
  backoff.expo,
253
  (HfHubHTTPError, requests.exceptions.Timeout, requests.exceptions.RequestException, Exception),
254
+ max_tries=MAX_RETRIES,
255
  base=300,
256
  max_value=3600,
257
  giveup=lambda e: not is_retryable_error(e),