Change response from echo to yes/no
Browse files
app.py
CHANGED
|
@@ -1,8 +1,11 @@
|
|
| 1 |
import gradio as gr
|
|
|
|
| 2 |
|
| 3 |
def echo(message, history):
|
| 4 |
-
|
|
|
|
|
|
|
|
|
|
| 5 |
|
| 6 |
-
chatbot = gr.ChatInterface(echo)
|
| 7 |
|
| 8 |
chatbot.launch()
|
|
|
|
| 1 |
import gradio as gr
|
| 2 |
+
import random
|
| 3 |
|
| 4 |
def echo(message, history):
|
| 5 |
+
my_list = ["yes", "no"]
|
| 6 |
+
return random.choice(my_list)
|
| 7 |
+
|
| 8 |
+
chatbot = gr.ChatInterface(echo, type = "messages")
|
| 9 |
|
|
|
|
| 10 |
|
| 11 |
chatbot.launch()
|