Spaces:
Sleeping
Sleeping
Added function yes_or_no
Browse files
app.py
CHANGED
|
@@ -1,8 +1,15 @@
|
|
| 1 |
import gradio as gr
|
|
|
|
| 2 |
|
| 3 |
def echo(message, history):
|
| 4 |
-
print("Hello, world!")
|
| 5 |
-
return
|
| 6 |
|
| 7 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 8 |
chatbot.launch()
|
|
|
|
| 1 |
import gradio as gr
|
| 2 |
+
import random
|
| 3 |
|
| 4 |
def echo(message, history):
|
| 5 |
+
print("Hello, world!")
|
| 6 |
+
return response
|
| 7 |
|
| 8 |
+
def yes_or_no(message, history):
|
| 9 |
+
responses = ['yes', 'no']
|
| 10 |
+
print("message:", message)
|
| 11 |
+
print("history:", history)
|
| 12 |
+
return random.choice(response)
|
| 13 |
+
|
| 14 |
+
chatbot = gr.ChatInterface(yes_or_no, type='messages')
|
| 15 |
chatbot.launch()
|