Skip to content

Commit 5185195

Browse files
committed
fix: launch.py.
1 parent 50c4a4c commit 5185195

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

launch.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ def downloadFile(urls, path: str):
6060
with open(path, 'wb') as file:
6161
for url in urls:
6262
startPosition = file.tell()
63+
success = False
6364
for attempt in range(8):
6465
print(f'📄 {url} (attempt: {attempt})')
6566
try:
@@ -74,12 +75,15 @@ def downloadFile(urls, path: str):
7475
sys.stdout.write("\rDownloaded %i MB" % sizeMb)
7576
lastSizeMb = sizeMb
7677
sys.stdout.write('\n')
78+
success = True
7779
break
7880
except Exception as e:
7981
print(f'\n❌ Error downloading {url}: {e}')
8082
file.seek(startPosition)
8183
file.truncate()
8284
time.sleep(1 * attempt)
85+
if not success:
86+
raise Exception(f'Failed to download {url}')
8387
sys.stdout.write(' ✅\n')
8488

8589
def download(modelName: str, model: list):

0 commit comments

Comments
 (0)