Spaces:
Runtime error
Runtime error
johnowhitaker
commited on
Commit
•
197f5c3
1
Parent(s):
8d8ff75
Update app.py
Browse files
app.py
CHANGED
@@ -4,12 +4,18 @@ from os.path import file_exists
|
|
4 |
import requests
|
5 |
|
6 |
model_fn = 'quick_224px'
|
|
|
|
|
7 |
if not file_exists(model_fn):
|
|
|
8 |
with requests.get(url, stream=True) as r:
|
9 |
r.raise_for_status()
|
10 |
with open(model_fn, 'wb') as f:
|
11 |
for chunk in r.iter_content(chunk_size=8192):
|
12 |
f.write(chunk)
|
|
|
|
|
|
|
13 |
|
14 |
# Load the model
|
15 |
def open_img(fn:Path): return Image.open(fn).convert('RGB').copy()
|
|
|
4 |
import requests
|
5 |
|
6 |
model_fn = 'quick_224px'
|
7 |
+
url = 'https://huggingface.co/johnowhitaker/sketchy_unet_rn34/resolve/main/quick_224px'
|
8 |
+
|
9 |
if not file_exists(model_fn):
|
10 |
+
print('starting download')
|
11 |
with requests.get(url, stream=True) as r:
|
12 |
r.raise_for_status()
|
13 |
with open(model_fn, 'wb') as f:
|
14 |
for chunk in r.iter_content(chunk_size=8192):
|
15 |
f.write(chunk)
|
16 |
+
print('done')
|
17 |
+
else:
|
18 |
+
print('file exists')
|
19 |
|
20 |
# Load the model
|
21 |
def open_img(fn:Path): return Image.open(fn).convert('RGB').copy()
|