Spaces:
Runtime error
Runtime error
try
Browse files
app.py
CHANGED
|
@@ -1,8 +1,17 @@
|
|
| 1 |
import gradio as gr
|
| 2 |
import random
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 3 |
def random_message(message, history):
|
| 4 |
choices = ["you have 24 hours", "yay ur lucky or whateva", "do not step outside", "try again", "pop quiz days be like", "please tell me you're not asking about a man.", "my sources tell me no", "haha you thought", "Im like 90.9% sure your being watched"]
|
| 5 |
random_element = random.choice(choices)
|
| 6 |
return random_element
|
| 7 |
-
chatbot = gr.ChatInterface(
|
| 8 |
-
|
|
|
|
|
|
| 1 |
import gradio as gr
|
| 2 |
import random
|
| 3 |
+
from huggingface_hub import InferenceClient
|
| 4 |
+
|
| 5 |
+
client = InferenceClient("HuggingFaceH4/zephyr-7b-beta")
|
| 6 |
+
|
| 7 |
+
def respond(message, history):
|
| 8 |
+
messages: [{"role": "system", "content": "You are a friendly chatbot."}]
|
| 9 |
+
if history:
|
| 10 |
+
messages.extend(history)
|
| 11 |
def random_message(message, history):
|
| 12 |
choices = ["you have 24 hours", "yay ur lucky or whateva", "do not step outside", "try again", "pop quiz days be like", "please tell me you're not asking about a man.", "my sources tell me no", "haha you thought", "Im like 90.9% sure your being watched"]
|
| 13 |
random_element = random.choice(choices)
|
| 14 |
return random_element
|
| 15 |
+
chatbot = gr.ChatInterface(echo, type="messages", description ="<strong><center>Welcome to your 8 ball.</strong><br>Ask Me Anything", title="Eight Ball")
|
| 16 |
+
|
| 17 |
+
chatbot.launch()
|