Spaces:
Sleeping
Sleeping
Respond Yes No Randomly Function
Browse files
app.py
CHANGED
|
@@ -1,9 +1,12 @@
|
|
| 1 |
import gradio as gr
|
|
|
|
| 2 |
|
| 3 |
-
def
|
| 4 |
-
|
|
|
|
| 5 |
|
| 6 |
-
|
|
|
|
| 7 |
|
| 8 |
chatbot.launch()
|
| 9 |
|
|
|
|
| 1 |
import gradio as gr
|
| 2 |
+
import random
|
| 3 |
|
| 4 |
+
def respond_yes_no_random(message, history):
|
| 5 |
+
responses = ["yes", "no"]
|
| 6 |
+
return random.choice(responses)
|
| 7 |
|
| 8 |
+
|
| 9 |
+
chatbot = gr.ChatInterface(respond_yes_no_random, type = "messages")
|
| 10 |
|
| 11 |
chatbot.launch()
|
| 12 |
|