Update app.py
Browse files
app.py
CHANGED
|
@@ -1,15 +1,19 @@
|
|
| 1 |
import gradio as gr
|
| 2 |
import random
|
| 3 |
|
| 4 |
-
def echo(message,history):
|
| 5 |
-
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
else:
|
| 9 |
-
|
| 10 |
-
return message
|
|
|
|
|
|
|
|
|
|
|
|
|
| 11 |
|
| 12 |
print("'hello world!'")
|
| 13 |
|
| 14 |
-
chatbot = gr.ChatInterface(
|
| 15 |
chatbot.launch()
|
|
|
|
| 1 |
import gradio as gr
|
| 2 |
import random
|
| 3 |
|
| 4 |
+
#def echo(message,history):
|
| 5 |
+
# numberval = random.randint(0,1)
|
| 6 |
+
# if numberval == 0:
|
| 7 |
+
# message = "yes"
|
| 8 |
+
#else:
|
| 9 |
+
# message = "no"
|
| 10 |
+
#return message
|
| 11 |
+
|
| 12 |
+
def respond_yes_no_randomly(message, history):
|
| 13 |
+
responses = ["yes", "no"]
|
| 14 |
+
return random.choice(responses)
|
| 15 |
|
| 16 |
print("'hello world!'")
|
| 17 |
|
| 18 |
+
chatbot = gr.ChatInterface(respond_yes_no_randomly, type="messages", title="Yes-No Chatbot")
|
| 19 |
chatbot.launch()
|