Spaces:
Runtime error
Runtime error
Abid
commited on
Commit
•
702efd2
1
Parent(s):
5aa0565
chatbot blocks added
Browse files
app.py
CHANGED
@@ -42,13 +42,14 @@ with demo:
|
|
42 |
</center>
|
43 |
"""
|
44 |
)
|
45 |
-
|
46 |
-
gr.
|
47 |
-
|
48 |
-
|
49 |
-
|
50 |
-
inputs=["text", "state"],
|
51 |
-
outputs=["chatbot", "state"],
|
52 |
)
|
53 |
|
|
|
|
|
|
|
54 |
demo.launch()
|
|
|
42 |
</center>
|
43 |
"""
|
44 |
)
|
45 |
+
state = gr.Variable(default_value=[])
|
46 |
+
chatbot = gr.Chatbot()
|
47 |
+
text = gr.Textbox(
|
48 |
+
label="Talk to Morty here... (press enter to submit)",
|
49 |
+
default_value="How are you?",
|
|
|
|
|
50 |
)
|
51 |
|
52 |
+
text.submit(predict, [text, state], [chatbot, state])
|
53 |
+
text.submit(lambda x: "", text, text)
|
54 |
+
|
55 |
demo.launch()
|