SefyanKehail
commited on
Commit
·
7d807f6
1
Parent(s):
3c80605
Dropbox Models'
Browse files
app.py
CHANGED
|
@@ -3,11 +3,18 @@ import requests
|
|
| 3 |
import IPython.display as display
|
| 4 |
import gradio as gr
|
| 5 |
import multiprocessing
|
|
|
|
| 6 |
|
| 7 |
def download_file(url, filename):
|
| 8 |
-
|
| 9 |
-
|
| 10 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 11 |
|
| 12 |
|
| 13 |
model_urls = {
|
|
|
|
| 3 |
import IPython.display as display
|
| 4 |
import gradio as gr
|
| 5 |
import multiprocessing
|
| 6 |
+
import os
|
| 7 |
|
| 8 |
def download_file(url, filename):
|
| 9 |
+
if not os.path.exists(filename):
|
| 10 |
+
print(f"{filename} files missing. Downloading ...")
|
| 11 |
+
response = requests.get(url, stream=True)
|
| 12 |
+
with open(filename, 'wb') as file:
|
| 13 |
+
for chunk in response.iter_content(chunk_size=8192):
|
| 14 |
+
if chunk:
|
| 15 |
+
file.write(chunk)
|
| 16 |
+
else:
|
| 17 |
+
print(f"{filename} exists. Skipping download")
|
| 18 |
|
| 19 |
|
| 20 |
model_urls = {
|