Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -1,10 +1,8 @@
|
|
1 |
import gradio as gr
|
2 |
from huggingface_hub import InferenceClient
|
3 |
|
4 |
-
# Connect to Hugging Face model
|
5 |
client = InferenceClient("HuggingFaceH4/zephyr-7b-beta")
|
6 |
|
7 |
-
# Define the chat response function
|
8 |
def respond(
|
9 |
message,
|
10 |
history: list[tuple[str, str]],
|
@@ -36,18 +34,24 @@ def respond(
|
|
36 |
response += token
|
37 |
yield response
|
38 |
|
39 |
-
# Gradio interface layout
|
40 |
demo = gr.ChatInterface(
|
41 |
respond,
|
42 |
additional_inputs=[
|
43 |
gr.Textbox(value="You are a friendly Chatbot.", label="System message"),
|
44 |
],
|
45 |
-
css="
|
46 |
-
|
47 |
-
|
48 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
49 |
)
|
50 |
|
51 |
if __name__ == "__main__":
|
52 |
demo.launch()
|
53 |
-
|
|
|
1 |
import gradio as gr
|
2 |
from huggingface_hub import InferenceClient
|
3 |
|
|
|
4 |
client = InferenceClient("HuggingFaceH4/zephyr-7b-beta")
|
5 |
|
|
|
6 |
def respond(
|
7 |
message,
|
8 |
history: list[tuple[str, str]],
|
|
|
34 |
response += token
|
35 |
yield response
|
36 |
|
|
|
37 |
demo = gr.ChatInterface(
|
38 |
respond,
|
39 |
additional_inputs=[
|
40 |
gr.Textbox(value="You are a friendly Chatbot.", label="System message"),
|
41 |
],
|
42 |
+
css="""
|
43 |
+
.gradio-container {background-color: #ffeef8; font-family: 'Comic Sans MS', sans-serif;}
|
44 |
+
.gr-button {background-color: #ff88cc; color: white; border-radius: 12px; padding: 10px;}
|
45 |
+
.gr-input {border: 2px solid #ff66b2; border-radius: 10px; background-color: #fff1f5; font-size: 18px;}
|
46 |
+
.gr-output {border: 2px solid #ff66b2; border-radius: 10px; padding: 15px; background-color: #ffffff; font-size: 18px; font-weight: bold;}
|
47 |
+
.gr-button:hover {background-color: #ff66b2; transition: background-color 0.3s;}
|
48 |
+
.gr-textbox {background-color: #fff1f5;}
|
49 |
+
.gradio-interface {padding: 20px; margin: 20px; box-shadow: 0px 4px 8px rgba(0, 0, 0, 0.1);}
|
50 |
+
.gradio-container input, .gradio-container button {font-family: 'Comic Sans MS', sans-serif;}
|
51 |
+
""",
|
52 |
+
title="Cuddly Chatbot πΎ",
|
53 |
+
description="A sweet and friendly assistant for all your questions! π",
|
54 |
)
|
55 |
|
56 |
if __name__ == "__main__":
|
57 |
demo.launch()
|
|