Spaces:
Sleeping
Sleeping
Update app.py
Browse filesmade chatbot only return yes or no instead of copying input
app.py
CHANGED
|
@@ -1,9 +1,11 @@
|
|
| 1 |
import gradio as gr
|
|
|
|
| 2 |
|
| 3 |
-
def
|
| 4 |
-
|
|
|
|
| 5 |
|
| 6 |
print("Hello, world!")
|
| 7 |
|
| 8 |
-
chatbot = gr.ChatInterface(
|
| 9 |
-
chatbot.launch()
|
|
|
|
| 1 |
import gradio as gr
|
| 2 |
+
import random
|
| 3 |
|
| 4 |
+
def respond_yes_no_randomly(message, history):
|
| 5 |
+
responses = ["yes", "no"]
|
| 6 |
+
return random.choice(responses)
|
| 7 |
|
| 8 |
print("Hello, world!")
|
| 9 |
|
| 10 |
+
chatbot = gr.ChatInterface(respond_yes_no_randomly, type = "messages", title = "Yes/No Bot") #chatbot UI = conversation history and user input
|
| 11 |
+
chatbot.launch() #displays the chatbot
|