Spaces:
Sleeping
Sleeping
added randomizer for responses
Browse files
app.py
CHANGED
|
@@ -1,8 +1,12 @@
|
|
| 1 |
import gradio as gr
|
|
|
|
| 2 |
|
| 3 |
-
def
|
| 4 |
-
|
|
|
|
|
|
|
|
|
|
| 5 |
|
| 6 |
-
chatbot = gr.ChatInterface(
|
| 7 |
|
| 8 |
chatbot.launch()
|
|
|
|
| 1 |
import gradio as gr
|
| 2 |
+
import random
|
| 3 |
|
| 4 |
+
def random_message(message, history):
|
| 5 |
+
choices = ["yes", "no"]
|
| 6 |
+
#use random to select one of those choices
|
| 7 |
+
chat_answer = random.choice(choices)
|
| 8 |
+
return chat_answer
|
| 9 |
|
| 10 |
+
chatbot = gr.ChatInterface(random_message, type = "messages")
|
| 11 |
|
| 12 |
chatbot.launch()
|