Spaces:
Runtime error
Runtime error
Update app
Browse files
app.py
CHANGED
@@ -14,7 +14,11 @@ import skimage
|
|
14 |
import skimage.measure
|
15 |
from utils import *
|
16 |
|
17 |
-
|
|
|
|
|
|
|
|
|
18 |
def load_html():
|
19 |
body, canvaspy = "", ""
|
20 |
with open("index.html", encoding="utf8") as f:
|
@@ -224,9 +228,8 @@ outpaint_button_js = load_js("outpaint")
|
|
224 |
proceed_button_js = load_js("proceed")
|
225 |
mode_js = load_js("mode")
|
226 |
setup_button_js = load_js("setup")
|
227 |
-
if not
|
228 |
-
|
229 |
-
pass
|
230 |
get_model(get_token())
|
231 |
|
232 |
with blocks as demo:
|
|
|
14 |
import skimage.measure
|
15 |
from utils import *
|
16 |
|
17 |
+
try:
|
18 |
+
cuda_available = torch.cuda.is_available()
|
19 |
+
except:
|
20 |
+
cuda_available = False
|
21 |
+
|
22 |
def load_html():
|
23 |
body, canvaspy = "", ""
|
24 |
with open("index.html", encoding="utf8") as f:
|
|
|
228 |
proceed_button_js = load_js("proceed")
|
229 |
mode_js = load_js("mode")
|
230 |
setup_button_js = load_js("setup")
|
231 |
+
if not cuda_available:
|
232 |
+
get_model = lambda x:x
|
|
|
233 |
get_model(get_token())
|
234 |
|
235 |
with blocks as demo:
|