Spaces:
Runtime error
Runtime error
basic_8Ball_chatbot
Browse files
app.py
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import gradio as gr
|
| 2 |
+
import random
|
| 3 |
+
#import lines fo at the top! Any libraries I need to import go here
|
| 4 |
+
|
| 5 |
+
client = InferenceClient("HuggingFaceH4/zephyr-7b-beta")
|
| 6 |
+
|
| 7 |
+
def magic_8_ball(message, history):
|
| 8 |
+
return random.choice(['Yes', "No","Try again", "Definitely", "Most likely not", "Without a doubt"])
|
| 9 |
+
|
| 10 |
+
#def yes_or_no(message, history):
|
| 11 |
+
#return random.choice(['Yes', "No"])
|
| 12 |
+
|
| 13 |
+
#def echo(message, history):
|
| 14 |
+
#return message
|
| 15 |
+
#a function that the user's message is repeated back to you
|
| 16 |
+
|
| 17 |
+
print("Hello World")
|
| 18 |
+
chatbot = gr.ChatInterface(magic_8_ball, type="messages", title="Magic 8 Ball", description="I will answer all of your questions about the future! Matt's ex: https://huggingface.co/spaces/mgetz/SanFran/blob/main/app.py")
|
| 19 |
+
#defining my chatbot so that the user can interact and see their conversation history and send me messages
|
| 20 |
+
|
| 21 |
+
chatbot.launch()
|