Spaces:
Sleeping
Sleeping
Created magic_eight_ball function
Browse files
app.py
CHANGED
|
@@ -2,14 +2,17 @@ import gradio as gr
|
|
| 2 |
import random
|
| 3 |
# import lines go at the top! Any libraries I need to import go up ^
|
| 4 |
|
| 5 |
-
def
|
| 6 |
-
return random.choice(['
|
|
|
|
|
|
|
|
|
|
| 7 |
|
| 8 |
# always need two parameters in hf
|
| 9 |
# def echo(message, history):
|
| 10 |
# return message
|
| 11 |
print("hello world")
|
| 12 |
-
chatbot = gr.ChatInterface(
|
| 13 |
# declaring chatbot so that user can interact and see their conversation history and send new messages
|
| 14 |
|
| 15 |
chatbot.launch()
|
|
|
|
| 2 |
import random
|
| 3 |
# import lines go at the top! Any libraries I need to import go up ^
|
| 4 |
|
| 5 |
+
def magic_eight_ball(message, history):
|
| 6 |
+
return random.choice(['Possibly', 'Absolutely not', 'If you try', "Why not", 'Yes!'])
|
| 7 |
+
|
| 8 |
+
#def yes_or_no(message, history):
|
| 9 |
+
# return random.choice(['Yes','No'])
|
| 10 |
|
| 11 |
# always need two parameters in hf
|
| 12 |
# def echo(message, history):
|
| 13 |
# return message
|
| 14 |
print("hello world")
|
| 15 |
+
chatbot = gr.ChatInterface(magic_eight_ball, type="messages")
|
| 16 |
# declaring chatbot so that user can interact and see their conversation history and send new messages
|
| 17 |
|
| 18 |
chatbot.launch()
|