Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -44,8 +44,13 @@ def chat_inf(system_prompt,prompt,history):
|
|
44 |
history.append((prompt,output))
|
45 |
yield history
|
46 |
|
47 |
-
def get_screenshot(chat: list,height=5000,width=600,chatblock=[
|
48 |
-
|
|
|
|
|
|
|
|
|
|
|
49 |
# str in 'Chat: [('user','bot'),('user','bot')]' Textbox component
|
50 |
# float in 'Height' Number component
|
51 |
# float in 'Width' Number component
|
@@ -60,7 +65,8 @@ def get_screenshot(chat: list,height=5000,width=600,chatblock=[1],theme="light",
|
|
60 |
# str representing output in 'value_20' Html component,
|
61 |
# List[Dict(image: filepath, caption: str | None)] representing output in 'value_24' Gallery component,
|
62 |
# filepath representing output in 'value_23' Image component,
|
63 |
-
out = f'https://omnibus-html-image-current-tab.hf.space/file={result[0]}'
|
|
|
64 |
print(out)
|
65 |
return out
|
66 |
|
@@ -89,7 +95,7 @@ with gr.Blocks() as app:
|
|
89 |
im_width=gr.Number(label="Width",value=500)
|
90 |
wait_time=gr.Number(label="Wait Time",value=3000)
|
91 |
theme=gr.Radio(label="Theme", choices=["light","dark"],value="light")
|
92 |
-
chatblock=gr.Dropdown(label="Chatblocks",choices=[c for c in range(1,40)],multiselect=True
|
93 |
|
94 |
im_btn=gr.Button("Screenshot")
|
95 |
img=gr.Image(type='filepath')
|
|
|
44 |
history.append((prompt,output))
|
45 |
yield history
|
46 |
|
47 |
+
def get_screenshot(chat: list,height=5000,width=600,chatblock=[],theme="light",wait=3000,header=True):
|
48 |
+
print(chatblock)
|
49 |
+
tog = 0
|
50 |
+
if chatblock:
|
51 |
+
tog = 3
|
52 |
+
|
53 |
+
result = ss_client.predict(str(chat),height,width,chatblock,header,theme,wait,api_name="/run_script")
|
54 |
# str in 'Chat: [('user','bot'),('user','bot')]' Textbox component
|
55 |
# float in 'Height' Number component
|
56 |
# float in 'Width' Number component
|
|
|
65 |
# str representing output in 'value_20' Html component,
|
66 |
# List[Dict(image: filepath, caption: str | None)] representing output in 'value_24' Gallery component,
|
67 |
# filepath representing output in 'value_23' Image component,
|
68 |
+
#out = f'https://omnibus-html-image-current-tab.hf.space/file={result[0]}'
|
69 |
+
out = f'https://omnibus-html-image-current-tab.hf.space/file={result[tog]}'
|
70 |
print(out)
|
71 |
return out
|
72 |
|
|
|
95 |
im_width=gr.Number(label="Width",value=500)
|
96 |
wait_time=gr.Number(label="Wait Time",value=3000)
|
97 |
theme=gr.Radio(label="Theme", choices=["light","dark"],value="light")
|
98 |
+
chatblock=gr.Dropdown(label="Chatblocks",choices=[c for c in range(1,40)],multiselect=True)
|
99 |
|
100 |
im_btn=gr.Button("Screenshot")
|
101 |
img=gr.Image(type='filepath')
|