Spaces:
Sleeping
Sleeping
zhimin-z
commited on
Commit
·
ddf12d3
1
Parent(s):
324acea
refine
Browse files
msr.py
CHANGED
|
@@ -137,12 +137,9 @@ def download_file(url):
|
|
| 137 |
return True
|
| 138 |
|
| 139 |
except Exception as e:
|
| 140 |
-
|
| 141 |
-
|
| 142 |
-
|
| 143 |
-
time.sleep(wait_time)
|
| 144 |
-
else:
|
| 145 |
-
print(f" ✗ {filename}: Failed after {MAX_RETRIES} attempts - {e}")
|
| 146 |
|
| 147 |
return False
|
| 148 |
|
|
@@ -489,12 +486,8 @@ def upload_single_file_with_retry(api, local_path, repo_path, repo_id, repo_type
|
|
| 489 |
)
|
| 490 |
return True
|
| 491 |
except Exception as e:
|
| 492 |
-
|
| 493 |
-
|
| 494 |
-
time.sleep(UPLOAD_MAX_BACKOFF)
|
| 495 |
-
else:
|
| 496 |
-
print(f" Failed after {max_retries} attempts: {str(e)}")
|
| 497 |
-
return False
|
| 498 |
return False
|
| 499 |
|
| 500 |
|
|
|
|
| 137 |
return True
|
| 138 |
|
| 139 |
except Exception as e:
|
| 140 |
+
wait_time = DOWNLOAD_RETRY_DELAY * (2 ** attempt)
|
| 141 |
+
print(f" ⚠ {filename}: {e}, retrying in {wait_time}s (attempt {attempt + 1}/{MAX_RETRIES})")
|
| 142 |
+
time.sleep(wait_time)
|
|
|
|
|
|
|
|
|
|
| 143 |
|
| 144 |
return False
|
| 145 |
|
|
|
|
| 486 |
)
|
| 487 |
return True
|
| 488 |
except Exception as e:
|
| 489 |
+
print(f" {e} error on attempt {attempt + 1}/{max_retries}. Retrying in {UPLOAD_MAX_BACKOFF}s...")
|
| 490 |
+
time.sleep(UPLOAD_MAX_BACKOFF)
|
|
|
|
|
|
|
|
|
|
|
|
|
| 491 |
return False
|
| 492 |
|
| 493 |
|