Spaces:
Sleeping
Sleeping
updated to import random and yes or no response
Browse files
app.py
CHANGED
|
@@ -1,8 +1,12 @@
|
|
| 1 |
import gradio as gr
|
|
|
|
| 2 |
|
| 3 |
def echo(message, history):
|
|
|
|
|
|
|
|
|
|
| 4 |
return message
|
| 5 |
-
|
| 6 |
chatbot = gr.ChatInterface(echo, type = "messages")
|
| 7 |
|
| 8 |
chatbot.launch()
|
|
|
|
| 1 |
import gradio as gr
|
| 2 |
+
import random
|
| 3 |
|
| 4 |
def echo(message, history):
|
| 5 |
+
choices = ["yes", "no"]
|
| 6 |
+
#use random to select one of these choices
|
| 7 |
+
|
| 8 |
return message
|
| 9 |
+
print(f{random.choice(choices)})
|
| 10 |
chatbot = gr.ChatInterface(echo, type = "messages")
|
| 11 |
|
| 12 |
chatbot.launch()
|