Spaces:
Runtime error
Runtime error
Commit
·
4ac79c2
1
Parent(s):
917e741
Update app.py
Browse files
app.py
CHANGED
@@ -32,24 +32,27 @@ response = palm.chat(
|
|
32 |
)
|
33 |
|
34 |
|
35 |
-
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
-
|
44 |
-
|
45 |
-
|
46 |
-
|
47 |
-
|
48 |
-
|
49 |
-
|
50 |
-
|
51 |
-
|
52 |
-
|
53 |
-
|
|
|
|
|
|
|
54 |
|
55 |
iface.launch()
|
|
|
32 |
)
|
33 |
|
34 |
|
35 |
+
|
36 |
+
|
37 |
+
|
38 |
+
with gr.Blocks() as demo:
|
39 |
+
chatbot = gr.Chatbot()
|
40 |
+
msg = gr.Textbox()
|
41 |
+
clear = gr.ClearButton([msg, chatbot])
|
42 |
+
|
43 |
+
def respond(msg):
|
44 |
+
messages.append(msg)
|
45 |
+
bot_message = palm.chat(
|
46 |
+
**defaults,
|
47 |
+
context=context,
|
48 |
+
examples=examples,
|
49 |
+
messages=messages
|
50 |
+
)
|
51 |
+
time.sleep(2)
|
52 |
+
return bot_message['message'], messages
|
53 |
+
|
54 |
+
msg.submit(respond, [msg, chatbot], [msg, chatbot])
|
55 |
+
|
56 |
+
demo.launch()
|
57 |
|
58 |
iface.launch()
|