Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -3,6 +3,7 @@ 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]],
|
@@ -31,41 +32,13 @@ def respond(
|
|
31 |
top_p=top_p,
|
32 |
):
|
33 |
token = message.choices[0].delta.content
|
|
|
34 |
response += token
|
35 |
yield response
|
36 |
|
37 |
-
custom_css = """
|
38 |
-
body {
|
39 |
-
background-color: #1c1c1c; /* Darker, softer black */
|
40 |
-
color: #ffffff;
|
41 |
-
}
|
42 |
-
.gradio-container {
|
43 |
-
background-color: #1c1c1c !important;
|
44 |
-
}
|
45 |
-
.gradio-textbox, .gradio-slider {
|
46 |
-
border: 1px solid #ffffff !important;
|
47 |
-
background-color: #333333 !important; /* Slightly lighter black */
|
48 |
-
color: #ffffff !important;
|
49 |
-
box-shadow: 0 0 10px #00ff00 !important; /* Glowing effect */
|
50 |
-
}
|
51 |
-
.gradio-slider input[type=range] {
|
52 |
-
background-color: #00ff00 !important; /* Change slider color */
|
53 |
-
}
|
54 |
-
.gradio-button {
|
55 |
-
background-color: #00ff00 !important;
|
56 |
-
color: #1c1c1c !important;
|
57 |
-
border: none !important;
|
58 |
-
box-shadow: 0 0 10px #00ff00 !important; /* Glowing effect */
|
59 |
-
}
|
60 |
-
.gradio-chat {
|
61 |
-
background-color: #333333 !important; /* Slightly lighter black */
|
62 |
-
color: #ffffff !important;
|
63 |
-
}
|
64 |
-
.gradio-label {
|
65 |
-
color: #ffffff !important;
|
66 |
-
}
|
67 |
"""
|
68 |
-
|
|
|
69 |
demo = gr.ChatInterface(
|
70 |
respond,
|
71 |
additional_inputs=[
|
@@ -80,8 +53,9 @@ demo = gr.ChatInterface(
|
|
80 |
label="Top-p (nucleus sampling)",
|
81 |
),
|
82 |
],
|
83 |
-
css=custom_css
|
84 |
)
|
85 |
|
|
|
86 |
if __name__ == "__main__":
|
87 |
demo.launch()
|
|
|
|
3 |
|
4 |
client = InferenceClient("HuggingFaceH4/zephyr-7b-beta")
|
5 |
|
6 |
+
|
7 |
def respond(
|
8 |
message,
|
9 |
history: list[tuple[str, str]],
|
|
|
32 |
top_p=top_p,
|
33 |
):
|
34 |
token = message.choices[0].delta.content
|
35 |
+
|
36 |
response += token
|
37 |
yield response
|
38 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
39 |
"""
|
40 |
+
For information on how to customize the ChatInterface, peruse the gradio docs: https://www.gradio.app/docs/chatinterface
|
41 |
+
"""
|
42 |
demo = gr.ChatInterface(
|
43 |
respond,
|
44 |
additional_inputs=[
|
|
|
53 |
label="Top-p (nucleus sampling)",
|
54 |
),
|
55 |
],
|
|
|
56 |
)
|
57 |
|
58 |
+
|
59 |
if __name__ == "__main__":
|
60 |
demo.launch()
|
61 |
+
|