Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
|
@@ -213,12 +213,14 @@ def build_ui():
|
|
| 213 |
with gr.Blocks(
|
| 214 |
theme=gr.themes.Soft(primary_hue="indigo"),
|
| 215 |
css="""
|
| 216 |
-
/* --- Hide share
|
| 217 |
-
|
|
|
|
| 218 |
display: none !important;
|
|
|
|
| 219 |
}
|
| 220 |
|
| 221 |
-
/* ---
|
| 222 |
#ohamlab .message.user {
|
| 223 |
background-color: #4f46e5 !important;
|
| 224 |
color: white !important;
|
|
@@ -226,9 +228,10 @@ def build_ui():
|
|
| 226 |
align-self: flex-end !important;
|
| 227 |
text-align: right !important;
|
| 228 |
margin-left: 25%;
|
|
|
|
|
|
|
| 229 |
}
|
| 230 |
|
| 231 |
-
/* --- OhamLab (Left) Message Bubble --- */
|
| 232 |
#ohamlab .message.assistant {
|
| 233 |
background-color: #f8f9fa !important;
|
| 234 |
color: #111 !important;
|
|
@@ -236,12 +239,24 @@ def build_ui():
|
|
| 236 |
align-self: flex-start !important;
|
| 237 |
text-align: left !important;
|
| 238 |
margin-right: 25%;
|
|
|
|
|
|
|
| 239 |
}
|
| 240 |
-
#ohamlab .chatbot .wrap.svelte-1lcyrj3 > div > div > button {
|
| 241 |
-
display: none !important; /* hide share/delete icons */
|
| 242 |
-
}
|
| 243 |
|
| 244 |
-
/* ---
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 245 |
.gradio-container {
|
| 246 |
max-width: 900px !important;
|
| 247 |
margin: auto;
|
|
@@ -253,6 +268,7 @@ def build_ui():
|
|
| 253 |
border: 1px solid #d1d5db !important;
|
| 254 |
box-shadow: 0 1px 3px rgba(0,0,0,0.08);
|
| 255 |
}
|
|
|
|
| 256 |
button.primary {
|
| 257 |
background-color: #4f46e5 !important;
|
| 258 |
color: white !important;
|
|
@@ -261,9 +277,11 @@ def build_ui():
|
|
| 261 |
font-weight: 600;
|
| 262 |
transition: all 0.2s ease-in-out;
|
| 263 |
}
|
|
|
|
| 264 |
button.primary:hover {
|
| 265 |
background-color: #4338ca !important;
|
| 266 |
}
|
|
|
|
| 267 |
button.secondary {
|
| 268 |
background-color: #f3f4f6 !important;
|
| 269 |
border-radius: 10px !important;
|
|
@@ -271,12 +289,15 @@ def build_ui():
|
|
| 271 |
font-weight: 500;
|
| 272 |
transition: all 0.2s ease-in-out;
|
| 273 |
}
|
|
|
|
| 274 |
button.secondary:hover {
|
| 275 |
background-color: #e5e7eb !important;
|
| 276 |
}
|
| 277 |
""",
|
| 278 |
) as demo:
|
| 279 |
|
|
|
|
|
|
|
| 280 |
# Chatbot area
|
| 281 |
chatbot = gr.Chatbot(
|
| 282 |
label="💠 OhamLab Conversation",
|
|
|
|
| 213 |
with gr.Blocks(
|
| 214 |
theme=gr.themes.Soft(primary_hue="indigo"),
|
| 215 |
css="""
|
| 216 |
+
/* --- Hide share & delete buttons (Gradio v4 compatible) --- */
|
| 217 |
+
[class*="message-actions"] button,
|
| 218 |
+
[class*="message-controls"] button {
|
| 219 |
display: none !important;
|
| 220 |
+
visibility: hidden !important;
|
| 221 |
}
|
| 222 |
|
| 223 |
+
/* --- Chat layout styling --- */
|
| 224 |
#ohamlab .message.user {
|
| 225 |
background-color: #4f46e5 !important;
|
| 226 |
color: white !important;
|
|
|
|
| 228 |
align-self: flex-end !important;
|
| 229 |
text-align: right !important;
|
| 230 |
margin-left: 25%;
|
| 231 |
+
padding: 0.6rem 1rem !important;
|
| 232 |
+
max-width: 70%;
|
| 233 |
}
|
| 234 |
|
|
|
|
| 235 |
#ohamlab .message.assistant {
|
| 236 |
background-color: #f8f9fa !important;
|
| 237 |
color: #111 !important;
|
|
|
|
| 239 |
align-self: flex-start !important;
|
| 240 |
text-align: left !important;
|
| 241 |
margin-right: 25%;
|
| 242 |
+
padding: 0.6rem 1rem !important;
|
| 243 |
+
max-width: 70%;
|
| 244 |
}
|
|
|
|
|
|
|
|
|
|
| 245 |
|
| 246 |
+
/* --- Replace circular bot icon text with 'OhamLab' --- */
|
| 247 |
+
#ohamlab .avatar span,
|
| 248 |
+
#ohamlab .avatar {
|
| 249 |
+
background: none !important;
|
| 250 |
+
color: #4f46e5 !important;
|
| 251 |
+
font-weight: 700 !important;
|
| 252 |
+
font-size: 0.9rem !important;
|
| 253 |
+
}
|
| 254 |
+
#ohamlab .avatar::before {
|
| 255 |
+
content: "OhamLab" !important;
|
| 256 |
+
display: inline-block;
|
| 257 |
+
}
|
| 258 |
+
|
| 259 |
+
/* --- Container and Inputs --- */
|
| 260 |
.gradio-container {
|
| 261 |
max-width: 900px !important;
|
| 262 |
margin: auto;
|
|
|
|
| 268 |
border: 1px solid #d1d5db !important;
|
| 269 |
box-shadow: 0 1px 3px rgba(0,0,0,0.08);
|
| 270 |
}
|
| 271 |
+
|
| 272 |
button.primary {
|
| 273 |
background-color: #4f46e5 !important;
|
| 274 |
color: white !important;
|
|
|
|
| 277 |
font-weight: 600;
|
| 278 |
transition: all 0.2s ease-in-out;
|
| 279 |
}
|
| 280 |
+
|
| 281 |
button.primary:hover {
|
| 282 |
background-color: #4338ca !important;
|
| 283 |
}
|
| 284 |
+
|
| 285 |
button.secondary {
|
| 286 |
background-color: #f3f4f6 !important;
|
| 287 |
border-radius: 10px !important;
|
|
|
|
| 289 |
font-weight: 500;
|
| 290 |
transition: all 0.2s ease-in-out;
|
| 291 |
}
|
| 292 |
+
|
| 293 |
button.secondary:hover {
|
| 294 |
background-color: #e5e7eb !important;
|
| 295 |
}
|
| 296 |
""",
|
| 297 |
) as demo:
|
| 298 |
|
| 299 |
+
|
| 300 |
+
|
| 301 |
# Chatbot area
|
| 302 |
chatbot = gr.Chatbot(
|
| 303 |
label="💠 OhamLab Conversation",
|