Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -69,7 +69,7 @@ def make_filename(inp):
|
|
69 |
return filename
|
70 |
|
71 |
def get_screenshot(chat,css_in,w,h,user_c,bot_c,background_c,font_c):
|
72 |
-
print(
|
73 |
if user_c:
|
74 |
user_c=user_c.strip('""').strip("''")
|
75 |
css_in=css_in.replace("$user_c",user_c).replace("$bot_c",bot_c).replace("$background_c",background_c).replace("$font_c",font_c)
|
@@ -140,6 +140,8 @@ with gr.Blocks(css=css) as app:
|
|
140 |
with gr.Group():
|
141 |
stop_btn=gr.Button("Stop")
|
142 |
clear_btn=gr.Button("Clear")
|
|
|
|
|
143 |
with gr.Column(scale=1):
|
144 |
with gr.Group():
|
145 |
with gr.Row():
|
@@ -155,7 +157,6 @@ with gr.Blocks(css=css) as app:
|
|
155 |
|
156 |
im_btn=gr.Button("Screenshot")
|
157 |
img=gr.Image(type='filepath')
|
158 |
-
css_box=gr.Textbox(lines=50,value=css)
|
159 |
html_view=gr.HTML()
|
160 |
btn.click(chat_inf,[sys_inp,inp,chat_b],chat_b)
|
161 |
im_btn.click(get_screenshot,[chat_b,css_box,im_width,im_height,user_c,bot_c,background_c,font_c],[img,html_view])
|
|
|
69 |
return filename
|
70 |
|
71 |
def get_screenshot(chat,css_in,w,h,user_c,bot_c,background_c,font_c):
|
72 |
+
print(len(chat))
|
73 |
if user_c:
|
74 |
user_c=user_c.strip('""').strip("''")
|
75 |
css_in=css_in.replace("$user_c",user_c).replace("$bot_c",bot_c).replace("$background_c",background_c).replace("$font_c",font_c)
|
|
|
140 |
with gr.Group():
|
141 |
stop_btn=gr.Button("Stop")
|
142 |
clear_btn=gr.Button("Clear")
|
143 |
+
css_box=gr.Textbox(label="CSS",lines=50,value=css)
|
144 |
+
|
145 |
with gr.Column(scale=1):
|
146 |
with gr.Group():
|
147 |
with gr.Row():
|
|
|
157 |
|
158 |
im_btn=gr.Button("Screenshot")
|
159 |
img=gr.Image(type='filepath')
|
|
|
160 |
html_view=gr.HTML()
|
161 |
btn.click(chat_inf,[sys_inp,inp,chat_b],chat_b)
|
162 |
im_btn.click(get_screenshot,[chat_b,css_box,im_width,im_height,user_c,bot_c,background_c,font_c],[img,html_view])
|