Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -74,7 +74,15 @@ def slide_fn(val):
|
|
74 |
img2.save(f'tmpim2-{uid}.png')
|
75 |
return img2
|
76 |
|
77 |
-
def make_files(
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
78 |
model_id=t_name
|
79 |
files=[]
|
80 |
if t_image_url != None and t_image_url != "" and t_image==None:
|
@@ -223,7 +231,17 @@ def make_files(t_name,t_space,t_title,t_description,t_redirect,t_image=None,t_im
|
|
223 |
print (e)
|
224 |
return None
|
225 |
|
226 |
-
def build_space(
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
227 |
model_id=t_name
|
228 |
#model_id="omnibus/fff"
|
229 |
if token==None or token=="":
|
@@ -528,7 +546,7 @@ with gr.Blocks() as build_app:
|
|
528 |
|
529 |
t_image.change(up_c,[t_image,c_slider],c_image)
|
530 |
c_upbtn.click(slide_fn,c_slider,c_image)
|
531 |
-
build_button.click(build_space,[
|
532 |
dl_button.click(make_files,[t_name,t_space,t_title,t_description,t_redirect,t_image,t_image_url,option_token],files_out)
|
533 |
|
534 |
def_im.click(d_im,None,t_image)
|
|
|
74 |
img2.save(f'tmpim2-{uid}.png')
|
75 |
return img2
|
76 |
|
77 |
+
def make_files(t_space,t_title,t_description=None,t_name=None,t_redirect=None,t_image=None,t_image_url=None,token=None):
|
78 |
+
if t_description == None:
|
79 |
+
t_description = f'Embedded App'
|
80 |
+
if t_redirect == None:
|
81 |
+
t_redirect = t_space
|
82 |
+
if t_name == None:
|
83 |
+
t_name = t_space.split("//",1)[1].split(".",1)[0]
|
84 |
+
#https://omnibus-social-card-maker-dl.hf.space
|
85 |
+
print (t_name)
|
86 |
model_id=t_name
|
87 |
files=[]
|
88 |
if t_image_url != None and t_image_url != "" and t_image==None:
|
|
|
231 |
print (e)
|
232 |
return None
|
233 |
|
234 |
+
def build_space(t_space,t_title,t_description=None,t_name=None,t_redirect=None,t_image=None,t_image_url=None,token=None):
|
235 |
+
|
236 |
+
if t_description == None:
|
237 |
+
t_description = f'Embedded App'
|
238 |
+
if t_redirect == None:
|
239 |
+
t_redirect = t_space
|
240 |
+
if t_name == None:
|
241 |
+
t_name = t_space.split("//",1)[1].split(".",1)[0]
|
242 |
+
|
243 |
+
|
244 |
+
|
245 |
model_id=t_name
|
246 |
#model_id="omnibus/fff"
|
247 |
if token==None or token=="":
|
|
|
546 |
|
547 |
t_image.change(up_c,[t_image,c_slider],c_image)
|
548 |
c_upbtn.click(slide_fn,c_slider,c_image)
|
549 |
+
build_button.click(build_space,[t_space,t_title,t_description,t_name,t_redirect,t_image,t_image_url,option_token],output_html)
|
550 |
dl_button.click(make_files,[t_name,t_space,t_title,t_description,t_redirect,t_image,t_image_url,option_token],files_out)
|
551 |
|
552 |
def_im.click(d_im,None,t_image)
|