Spaces:
Sleeping
Sleeping
Create random yes or no response function
Browse files
app.py
CHANGED
|
@@ -1,8 +1,11 @@
|
|
| 1 |
import gradio as gr
|
|
|
|
| 2 |
|
| 3 |
-
|
| 4 |
-
|
|
|
|
|
|
|
| 5 |
|
| 6 |
-
chatbot = gr.ChatInterface(
|
| 7 |
|
| 8 |
chatbot.launch()
|
|
|
|
| 1 |
import gradio as gr
|
| 2 |
+
import random
|
| 3 |
|
| 4 |
+
#Chat responds yes or no randomly
|
| 5 |
+
def respond_yes_no_randomly(message,history):
|
| 6 |
+
responses =["Yes", "No"]
|
| 7 |
+
return random.choice(responses)
|
| 8 |
|
| 9 |
+
chatbot = gr.ChatInterface(respond_yes_no_randomly, type = "messages")
|
| 10 |
|
| 11 |
chatbot.launch()
|