Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -40,7 +40,7 @@ def chat_inf(system_prompt,prompt,history):
|
|
40 |
|
41 |
|
42 |
|
43 |
-
def get_screenshot(chat: list,height=5000,width=600,chatblock=[1],
|
44 |
result = ss_client.predict(chat,height,width,chatblock,header,theme,wait,api_name="/run_script")
|
45 |
# str in 'Chat: [('user','bot'),('user','bot')]' Textbox component
|
46 |
# float in 'Height' Number component
|
@@ -79,10 +79,17 @@ with gr.Blocks() as app:
|
|
79 |
stop_btn=gr.Button("Stop")
|
80 |
clear_btn=gr.Button("Clear")
|
81 |
with gr.Column(scale=1):
|
82 |
-
with gr.Group():
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
83 |
im_btn=gr.Button("Screenshot")
|
84 |
img=gr.Image(type='filepath')
|
85 |
btn.click(chat_inf,[sys_inp,inp,chat_b],chat_b)
|
86 |
-
im_btn.click(get_screenshot,
|
87 |
#app.load(get_screenshot,inp,img)
|
88 |
app.launch()
|
|
|
40 |
|
41 |
|
42 |
|
43 |
+
def get_screenshot(chat: list,height=5000,width=600,chatblock=[1],theme="light",wait=3000,header=True):
|
44 |
result = ss_client.predict(chat,height,width,chatblock,header,theme,wait,api_name="/run_script")
|
45 |
# str in 'Chat: [('user','bot'),('user','bot')]' Textbox component
|
46 |
# float in 'Height' Number component
|
|
|
79 |
stop_btn=gr.Button("Stop")
|
80 |
clear_btn=gr.Button("Clear")
|
81 |
with gr.Column(scale=1):
|
82 |
+
with gr.Group():
|
83 |
+
with gr.Row():
|
84 |
+
im_height=gr.Number(label="Height",value=5000)
|
85 |
+
im_width=gr.Number(label="Width",value=500)
|
86 |
+
wait_time=gr.Number(label="Wait Time",value=3000)
|
87 |
+
theme=gr.Radio(label="Theme", choices=["light","dark"])
|
88 |
+
chatblock=gr.Dropdown(label="Chatblocks",choices=[c for c in range(1,20)])
|
89 |
+
|
90 |
im_btn=gr.Button("Screenshot")
|
91 |
img=gr.Image(type='filepath')
|
92 |
btn.click(chat_inf,[sys_inp,inp,chat_b],chat_b)
|
93 |
+
im_btn.click(get_screenshot,[chat_b,im_height,im_width,chatblock,theme,wait_time],img)
|
94 |
#app.load(get_screenshot,inp,img)
|
95 |
app.launch()
|