Spaces:
Runtime error
Runtime error
Dagfinn1962
commited on
Commit
•
8fee7a9
1
Parent(s):
f53d66a
Update app.py
Browse files
app.py
CHANGED
@@ -148,38 +148,38 @@ with gr.Blocks(theme='HaleyCH/HaleyCH_Theme') as demo:
|
|
148 |
gr.Markdown(
|
149 |
"[Privacy policy](https://gist.github.com/samhavens/c29c68cdcd420a9aa0202d0839876dac)",
|
150 |
elem_classes=["disclaimer"],
|
151 |
-
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
152 |
|
153 |
-
|
154 |
-
fn=conversation.user_turn,
|
155 |
-
inputs=[msg],
|
156 |
-
outputs=[msg, chatbot],
|
157 |
-
queue=False,
|
158 |
-
).then(
|
159 |
-
fn=conversation.bot_turn,
|
160 |
-
inputs=[system, chatbot, openai_key],
|
161 |
-
outputs=[chatbot],
|
162 |
-
queue=True, # Change `queue=True` to `keep_in_queue=True`
|
163 |
-
)
|
164 |
-
submit_click_event = submit.click(
|
165 |
fn=conversation.user_turn,
|
166 |
inputs=[msg],
|
167 |
outputs=[msg, chatbot],
|
168 |
queue=False,
|
169 |
-
|
170 |
fn=conversation.bot_turn,
|
171 |
inputs=[system, chatbot, openai_key],
|
172 |
outputs=[chatbot],
|
173 |
queue=True, # Change `queue=True` to `keep_in_queue=True`
|
174 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
175 |
|
176 |
-
stop.click()
|
177 |
-
fn=None,
|
178 |
-
inputs=None,
|
179 |
-
outputs=None,
|
180 |
-
cancels=[submit_event, submit_click_event],
|
181 |
-
queue=False,
|
182 |
-
)
|
183 |
clear.click(lambda: None, None, chatbot, queue=False).then(
|
184 |
fn=conversation.clear_history,
|
185 |
inputs=[chatbot],
|
|
|
148 |
gr.Markdown(
|
149 |
"[Privacy policy](https://gist.github.com/samhavens/c29c68cdcd420a9aa0202d0839876dac)",
|
150 |
elem_classes=["disclaimer"],
|
151 |
+
)submit_event = msg.submit(
|
152 |
+
fn=conversation.user_turn,
|
153 |
+
inputs=[msg],
|
154 |
+
outputs=[msg, chatbot],
|
155 |
+
queue=False,
|
156 |
+
).then(
|
157 |
+
fn=conversation.bot_turn,
|
158 |
+
inputs=[system, chatbot, openai_key],
|
159 |
+
outputs=[chatbot],
|
160 |
+
queue=True, # Change `queue=True` to `keep_in_queue=True`
|
161 |
+
)
|
162 |
|
163 |
+
submit_click_event = submit.click(
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
164 |
fn=conversation.user_turn,
|
165 |
inputs=[msg],
|
166 |
outputs=[msg, chatbot],
|
167 |
queue=False,
|
168 |
+
).then(
|
169 |
fn=conversation.bot_turn,
|
170 |
inputs=[system, chatbot, openai_key],
|
171 |
outputs=[chatbot],
|
172 |
queue=True, # Change `queue=True` to `keep_in_queue=True`
|
173 |
+
)
|
174 |
+
|
175 |
+
stop.click(
|
176 |
+
fn=None,
|
177 |
+
inputs=None,
|
178 |
+
outputs=None,
|
179 |
+
cancels=[submit_event, submit_click_event],
|
180 |
+
queue=False,
|
181 |
+
)
|
182 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
183 |
clear.click(lambda: None, None, chatbot, queue=False).then(
|
184 |
fn=conversation.clear_history,
|
185 |
inputs=[chatbot],
|