Create app.py
Browse files
app.py
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import random
|
| 2 |
+
import gradio as gr
|
| 3 |
+
|
| 4 |
+
def chat(message, history):
|
| 5 |
+
history = history or []
|
| 6 |
+
|
| 7 |
+
history.append((message, "response"))
|
| 8 |
+
return history, history
|
| 9 |
+
|
| 10 |
+
chatbot = gr.Chatbot().style(color_map=("green", "pink"))
|
| 11 |
+
demo = gr.Interface(
|
| 12 |
+
chat,
|
| 13 |
+
["text", "state"],
|
| 14 |
+
[chatbot, "state"],
|
| 15 |
+
)
|
| 16 |
+
if __name__ == "__main__":
|
| 17 |
+
demo.launch()
|