Spaces:
Paused
Paused
Update app.py
Browse files
app.py
CHANGED
|
@@ -248,11 +248,11 @@ def process_query(query, history, selected_voice='af'):
|
|
| 248 |
audio_output: None
|
| 249 |
}
|
| 250 |
|
| 251 |
-
# ----------------------- Custom CSS for
|
| 252 |
css = """
|
| 253 |
.gradio-container {
|
| 254 |
max-width: 1200px !important;
|
| 255 |
-
background-color: #
|
| 256 |
padding: 20px;
|
| 257 |
border-radius: 12px;
|
| 258 |
}
|
|
@@ -260,9 +260,9 @@ css = """
|
|
| 260 |
#header {
|
| 261 |
text-align: center;
|
| 262 |
padding: 2rem 0;
|
| 263 |
-
background: #
|
| 264 |
border-radius: 12px;
|
| 265 |
-
color: #
|
| 266 |
margin-bottom: 2rem;
|
| 267 |
}
|
| 268 |
|
|
@@ -272,79 +272,83 @@ css = """
|
|
| 272 |
}
|
| 273 |
|
| 274 |
.search-container {
|
| 275 |
-
background: #
|
| 276 |
border-radius: 12px;
|
| 277 |
padding: 1.5rem;
|
| 278 |
margin-bottom: 1rem;
|
|
|
|
| 279 |
}
|
| 280 |
|
| 281 |
.search-box {
|
| 282 |
padding: 1rem;
|
| 283 |
-
background: #
|
| 284 |
border-radius: 8px;
|
| 285 |
margin-bottom: 1rem;
|
|
|
|
| 286 |
}
|
| 287 |
|
| 288 |
.search-box input[type="text"] {
|
| 289 |
-
background: #
|
| 290 |
-
border: 1px solid #
|
| 291 |
-
color: #
|
| 292 |
border-radius: 8px !important;
|
| 293 |
}
|
| 294 |
|
| 295 |
.search-box input[type="text"]::placeholder {
|
| 296 |
-
color: #
|
| 297 |
}
|
| 298 |
|
| 299 |
.search-box button {
|
| 300 |
-
background: #
|
| 301 |
border: none !important;
|
| 302 |
}
|
| 303 |
|
| 304 |
.results-container {
|
| 305 |
-
background: #
|
| 306 |
border-radius: 8px;
|
| 307 |
padding: 1.5rem;
|
| 308 |
margin-top: 1rem;
|
|
|
|
| 309 |
}
|
| 310 |
|
| 311 |
.answer-box {
|
| 312 |
-
background: #
|
| 313 |
border-radius: 8px;
|
| 314 |
padding: 1.5rem;
|
| 315 |
-
color: #
|
| 316 |
margin-bottom: 1rem;
|
| 317 |
}
|
| 318 |
|
| 319 |
.answer-box p {
|
| 320 |
-
color: #
|
| 321 |
line-height: 1.6;
|
| 322 |
}
|
| 323 |
|
| 324 |
.sources-container {
|
| 325 |
margin-top: 1rem;
|
| 326 |
-
background: #
|
| 327 |
border-radius: 8px;
|
| 328 |
padding: 1rem;
|
|
|
|
| 329 |
}
|
| 330 |
|
| 331 |
.source-item {
|
| 332 |
display: flex;
|
| 333 |
padding: 12px;
|
| 334 |
margin: 8px 0;
|
| 335 |
-
background: #
|
| 336 |
border-radius: 8px;
|
| 337 |
transition: all 0.2s;
|
| 338 |
}
|
| 339 |
|
| 340 |
.source-item:hover {
|
| 341 |
-
background: #
|
| 342 |
}
|
| 343 |
|
| 344 |
.source-number {
|
| 345 |
font-weight: bold;
|
| 346 |
margin-right: 12px;
|
| 347 |
-
color: #
|
| 348 |
}
|
| 349 |
|
| 350 |
.source-content {
|
|
@@ -352,7 +356,7 @@ css = """
|
|
| 352 |
}
|
| 353 |
|
| 354 |
.source-title {
|
| 355 |
-
color: #
|
| 356 |
font-weight: 500;
|
| 357 |
text-decoration: none;
|
| 358 |
display: block;
|
|
@@ -360,13 +364,13 @@ css = """
|
|
| 360 |
}
|
| 361 |
|
| 362 |
.source-date {
|
| 363 |
-
color: #
|
| 364 |
font-size: 0.9em;
|
| 365 |
margin-left: 8px;
|
| 366 |
}
|
| 367 |
|
| 368 |
.source-snippet {
|
| 369 |
-
color: #
|
| 370 |
font-size: 0.9em;
|
| 371 |
line-height: 1.4;
|
| 372 |
}
|
|
@@ -375,29 +379,31 @@ css = """
|
|
| 375 |
max-height: 400px;
|
| 376 |
overflow-y: auto;
|
| 377 |
padding: 1rem;
|
| 378 |
-
background: #
|
| 379 |
border-radius: 8px;
|
| 380 |
margin-top: 1rem;
|
|
|
|
| 381 |
}
|
| 382 |
|
| 383 |
.voice-selector {
|
| 384 |
margin-top: 1rem;
|
| 385 |
-
background: #
|
| 386 |
border-radius: 8px;
|
| 387 |
padding: 0.5rem;
|
|
|
|
| 388 |
}
|
| 389 |
|
| 390 |
.voice-selector select {
|
| 391 |
-
background: #
|
| 392 |
-
color: #
|
| 393 |
-
border: 1px solid #
|
| 394 |
}
|
| 395 |
|
| 396 |
footer {
|
| 397 |
text-align: center;
|
| 398 |
padding: 1rem 0;
|
| 399 |
font-size: 0.9em;
|
| 400 |
-
color: #
|
| 401 |
}
|
| 402 |
"""
|
| 403 |
|
|
@@ -405,7 +411,6 @@ footer {
|
|
| 405 |
with gr.Blocks(title="AI Search Assistant", css=css) as demo:
|
| 406 |
chat_history = gr.State([])
|
| 407 |
|
| 408 |
-
# 'id' ์ธ์ ๋์ 'elem_id' ์ฌ์ฉ
|
| 409 |
with gr.Column(elem_id="header"):
|
| 410 |
gr.Markdown("# ๐ AI Search Assistant")
|
| 411 |
gr.Markdown("### Powered by DeepSeek & Real-time Web Results with Voice")
|
|
|
|
| 248 |
audio_output: None
|
| 249 |
}
|
| 250 |
|
| 251 |
+
# ----------------------- Custom CSS for Bright UI ----------------------- #
|
| 252 |
css = """
|
| 253 |
.gradio-container {
|
| 254 |
max-width: 1200px !important;
|
| 255 |
+
background-color: #ffffff !important;
|
| 256 |
padding: 20px;
|
| 257 |
border-radius: 12px;
|
| 258 |
}
|
|
|
|
| 260 |
#header {
|
| 261 |
text-align: center;
|
| 262 |
padding: 2rem 0;
|
| 263 |
+
background: #f0f8ff;
|
| 264 |
border-radius: 12px;
|
| 265 |
+
color: #333333;
|
| 266 |
margin-bottom: 2rem;
|
| 267 |
}
|
| 268 |
|
|
|
|
| 272 |
}
|
| 273 |
|
| 274 |
.search-container {
|
| 275 |
+
background: #f8f9fa;
|
| 276 |
border-radius: 12px;
|
| 277 |
padding: 1.5rem;
|
| 278 |
margin-bottom: 1rem;
|
| 279 |
+
border: 1px solid #e0e0e0;
|
| 280 |
}
|
| 281 |
|
| 282 |
.search-box {
|
| 283 |
padding: 1rem;
|
| 284 |
+
background: #ffffff;
|
| 285 |
border-radius: 8px;
|
| 286 |
margin-bottom: 1rem;
|
| 287 |
+
border: 1px solid #e0e0e0;
|
| 288 |
}
|
| 289 |
|
| 290 |
.search-box input[type="text"] {
|
| 291 |
+
background: #ffffff !important;
|
| 292 |
+
border: 1px solid #cccccc !important;
|
| 293 |
+
color: #333333 !important;
|
| 294 |
border-radius: 8px !important;
|
| 295 |
}
|
| 296 |
|
| 297 |
.search-box input[type="text"]::placeholder {
|
| 298 |
+
color: #888888 !important;
|
| 299 |
}
|
| 300 |
|
| 301 |
.search-box button {
|
| 302 |
+
background: #007bff !important;
|
| 303 |
border: none !important;
|
| 304 |
}
|
| 305 |
|
| 306 |
.results-container {
|
| 307 |
+
background: #ffffff;
|
| 308 |
border-radius: 8px;
|
| 309 |
padding: 1.5rem;
|
| 310 |
margin-top: 1rem;
|
| 311 |
+
border: 1px solid #e0e0e0;
|
| 312 |
}
|
| 313 |
|
| 314 |
.answer-box {
|
| 315 |
+
background: #f1f1f1;
|
| 316 |
border-radius: 8px;
|
| 317 |
padding: 1.5rem;
|
| 318 |
+
color: #333333;
|
| 319 |
margin-bottom: 1rem;
|
| 320 |
}
|
| 321 |
|
| 322 |
.answer-box p {
|
| 323 |
+
color: #555555;
|
| 324 |
line-height: 1.6;
|
| 325 |
}
|
| 326 |
|
| 327 |
.sources-container {
|
| 328 |
margin-top: 1rem;
|
| 329 |
+
background: #ffffff;
|
| 330 |
border-radius: 8px;
|
| 331 |
padding: 1rem;
|
| 332 |
+
border: 1px solid #e0e0e0;
|
| 333 |
}
|
| 334 |
|
| 335 |
.source-item {
|
| 336 |
display: flex;
|
| 337 |
padding: 12px;
|
| 338 |
margin: 8px 0;
|
| 339 |
+
background: #f8f9fa;
|
| 340 |
border-radius: 8px;
|
| 341 |
transition: all 0.2s;
|
| 342 |
}
|
| 343 |
|
| 344 |
.source-item:hover {
|
| 345 |
+
background: #e9ecef;
|
| 346 |
}
|
| 347 |
|
| 348 |
.source-number {
|
| 349 |
font-weight: bold;
|
| 350 |
margin-right: 12px;
|
| 351 |
+
color: #007bff;
|
| 352 |
}
|
| 353 |
|
| 354 |
.source-content {
|
|
|
|
| 356 |
}
|
| 357 |
|
| 358 |
.source-title {
|
| 359 |
+
color: #007bff;
|
| 360 |
font-weight: 500;
|
| 361 |
text-decoration: none;
|
| 362 |
display: block;
|
|
|
|
| 364 |
}
|
| 365 |
|
| 366 |
.source-date {
|
| 367 |
+
color: #888888;
|
| 368 |
font-size: 0.9em;
|
| 369 |
margin-left: 8px;
|
| 370 |
}
|
| 371 |
|
| 372 |
.source-snippet {
|
| 373 |
+
color: #555555;
|
| 374 |
font-size: 0.9em;
|
| 375 |
line-height: 1.4;
|
| 376 |
}
|
|
|
|
| 379 |
max-height: 400px;
|
| 380 |
overflow-y: auto;
|
| 381 |
padding: 1rem;
|
| 382 |
+
background: #ffffff;
|
| 383 |
border-radius: 8px;
|
| 384 |
margin-top: 1rem;
|
| 385 |
+
border: 1px solid #e0e0e0;
|
| 386 |
}
|
| 387 |
|
| 388 |
.voice-selector {
|
| 389 |
margin-top: 1rem;
|
| 390 |
+
background: #ffffff;
|
| 391 |
border-radius: 8px;
|
| 392 |
padding: 0.5rem;
|
| 393 |
+
border: 1px solid #cccccc;
|
| 394 |
}
|
| 395 |
|
| 396 |
.voice-selector select {
|
| 397 |
+
background: #ffffff !important;
|
| 398 |
+
color: #333333 !important;
|
| 399 |
+
border: 1px solid #cccccc !important;
|
| 400 |
}
|
| 401 |
|
| 402 |
footer {
|
| 403 |
text-align: center;
|
| 404 |
padding: 1rem 0;
|
| 405 |
font-size: 0.9em;
|
| 406 |
+
color: #666666;
|
| 407 |
}
|
| 408 |
"""
|
| 409 |
|
|
|
|
| 411 |
with gr.Blocks(title="AI Search Assistant", css=css) as demo:
|
| 412 |
chat_history = gr.State([])
|
| 413 |
|
|
|
|
| 414 |
with gr.Column(elem_id="header"):
|
| 415 |
gr.Markdown("# ๐ AI Search Assistant")
|
| 416 |
gr.Markdown("### Powered by DeepSeek & Real-time Web Results with Voice")
|