Update app.py
Browse files
app.py
CHANGED
|
@@ -1,7 +1,8 @@
|
|
| 1 |
-
import gradio as gr
|
| 2 |
-
import random
|
| 3 |
-
def
|
| 4 |
-
|
| 5 |
-
return
|
| 6 |
-
|
| 7 |
-
chatbot.
|
|
|
|
|
|
| 1 |
+
import gradio as gr #importing gradio
|
| 2 |
+
import random
|
| 3 |
+
def respond_y_or_n_randomly(message, history):
|
| 4 |
+
responses = ["yes","no"]
|
| 5 |
+
return random.choice(responses)
|
| 6 |
+
#all print statements will be shown in the log after committing the changes to the main.
|
| 7 |
+
chatbot = gr.ChatInterface(respond_y_or_n_randomly, type = 'messages', title="Yes no bot") #builds chatbot UI - conversation history and user input
|
| 8 |
+
chatbot.launch() # launches the chatbot.
|