Update app.py
Browse files
app.py
CHANGED
@@ -1,9 +1,6 @@
|
|
1 |
import gradio as gr
|
2 |
from huggingface_hub import InferenceClient
|
3 |
|
4 |
-
"""
|
5 |
-
For more information on huggingface_hub Inference API support, please check the docs: https://huggingface.co/docs/huggingface_hub/v0.22.2/en/guides/inference
|
6 |
-
"""
|
7 |
client = InferenceClient("Qwen/QwQ-32B")
|
8 |
|
9 |
|
@@ -40,93 +37,7 @@ def respond(
|
|
40 |
yield response
|
41 |
|
42 |
|
43 |
-
#
|
44 |
-
metro_design_css = """
|
45 |
-
* {
|
46 |
-
margin: 0;
|
47 |
-
padding: 0;
|
48 |
-
box-sizing: border-box;
|
49 |
-
font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
|
50 |
-
}
|
51 |
-
|
52 |
-
.gradio-container {
|
53 |
-
background-color: #ffffff; /* White background */
|
54 |
-
padding: 20px;
|
55 |
-
border-radius: 8px;
|
56 |
-
box-shadow: 0 0 10px rgba(0, 0, 0, 0.1); /* Soft shadow */
|
57 |
-
}
|
58 |
-
|
59 |
-
.gradio-button {
|
60 |
-
background-color: #D32F2F; /* Metro red color */
|
61 |
-
color: white;
|
62 |
-
border: none;
|
63 |
-
border-radius: 5px;
|
64 |
-
padding: 12px 25px;
|
65 |
-
font-size: 16px;
|
66 |
-
cursor: pointer;
|
67 |
-
transition: background-color 0.3s ease;
|
68 |
-
}
|
69 |
-
|
70 |
-
.gradio-button:hover {
|
71 |
-
background-color: #C62828; /* Darker red */
|
72 |
-
}
|
73 |
-
|
74 |
-
.gradio-slider {
|
75 |
-
background-color: #f1f1f1;
|
76 |
-
border-radius: 8px;
|
77 |
-
border: 1px solid #ddd;
|
78 |
-
padding: 10px;
|
79 |
-
}
|
80 |
-
|
81 |
-
.gradio-textbox {
|
82 |
-
background-color: #ffffff;
|
83 |
-
border: 1px solid #ddd;
|
84 |
-
border-radius: 8px;
|
85 |
-
padding: 10px;
|
86 |
-
font-size: 14px;
|
87 |
-
width: 100%;
|
88 |
-
transition: border-color 0.3s ease;
|
89 |
-
}
|
90 |
-
|
91 |
-
.gradio-textbox:focus {
|
92 |
-
border-color: #D32F2F; /* Red color */
|
93 |
-
}
|
94 |
-
|
95 |
-
.gradio-label {
|
96 |
-
font-size: 14px;
|
97 |
-
font-weight: bold;
|
98 |
-
color: #333;
|
99 |
-
}
|
100 |
-
|
101 |
-
.gradio-interface .gradio-input-container {
|
102 |
-
margin-bottom: 20px;
|
103 |
-
}
|
104 |
-
|
105 |
-
.gradio-chat {
|
106 |
-
background-color: #ffffff; /* White background for chat messages */
|
107 |
-
border: 1px solid #ddd;
|
108 |
-
border-radius: 8px;
|
109 |
-
padding: 15px;
|
110 |
-
}
|
111 |
-
|
112 |
-
.gradio-chat .gradio-message {
|
113 |
-
background-color: #f1f1f1; /* Light gray for chat messages */
|
114 |
-
border-radius: 8px;
|
115 |
-
padding: 10px;
|
116 |
-
margin-bottom: 10px;
|
117 |
-
}
|
118 |
-
|
119 |
-
.gradio-chat .gradio-user-message {
|
120 |
-
background-color: #D32F2F; /* Red color for user messages */
|
121 |
-
color: white;
|
122 |
-
}
|
123 |
-
|
124 |
-
.gradio-chat .gradio-assistant-message {
|
125 |
-
background-color: #eeeeee; /* Lighter color for assistant's messages */
|
126 |
-
}
|
127 |
-
"""
|
128 |
-
|
129 |
-
# Launch the Gradio app with custom CSS
|
130 |
demo = gr.ChatInterface(
|
131 |
respond,
|
132 |
additional_inputs=[
|
@@ -141,7 +52,7 @@ demo = gr.ChatInterface(
|
|
141 |
label="Top-p (nucleus sampling)",
|
142 |
),
|
143 |
],
|
144 |
-
css=
|
145 |
)
|
146 |
|
147 |
|
|
|
1 |
import gradio as gr
|
2 |
from huggingface_hub import InferenceClient
|
3 |
|
|
|
|
|
|
|
4 |
client = InferenceClient("Qwen/QwQ-32B")
|
5 |
|
6 |
|
|
|
37 |
yield response
|
38 |
|
39 |
|
40 |
+
# Launch the Gradio app with the external CSS file
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
41 |
demo = gr.ChatInterface(
|
42 |
respond,
|
43 |
additional_inputs=[
|
|
|
52 |
label="Top-p (nucleus sampling)",
|
53 |
),
|
54 |
],
|
55 |
+
css="styles.css", # Reference to the external CSS file
|
56 |
)
|
57 |
|
58 |
|