Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -23,9 +23,9 @@ def get_whisper():
|
|
| 23 |
whisper_model = WhisperModel("base", compute_type="int8")
|
| 24 |
return whisper_model
|
| 25 |
|
| 26 |
-
GROQ_API_KEY = os.environ.get("
|
| 27 |
if not GROQ_API_KEY:
|
| 28 |
-
raise ValueError("
|
| 29 |
|
| 30 |
client = Groq(api_key=GROQ_API_KEY)
|
| 31 |
MODEL_NAME = "llama-3.3-70b-versatile"
|
|
@@ -283,444 +283,497 @@ def voice_chat(audio, history):
|
|
| 283 |
return history, ""
|
| 284 |
|
| 285 |
# =========================
|
| 286 |
-
# CSS β
|
|
|
|
|
|
|
| 287 |
# =========================
|
| 288 |
|
| 289 |
CSS = """
|
| 290 |
-
@import url('https://fonts.googleapis.com/css2?family=
|
| 291 |
|
|
|
|
| 292 |
:root {
|
| 293 |
-
--
|
| 294 |
-
--bg-
|
| 295 |
-
--bg-
|
| 296 |
-
--bg-
|
| 297 |
-
--bg-
|
| 298 |
-
--
|
| 299 |
-
--
|
| 300 |
-
--
|
| 301 |
-
--
|
| 302 |
-
--
|
| 303 |
-
--
|
| 304 |
-
--
|
| 305 |
-
--
|
| 306 |
-
--
|
| 307 |
-
--
|
| 308 |
-
--
|
| 309 |
-
--
|
| 310 |
-
--
|
| 311 |
-
--
|
| 312 |
-
--
|
| 313 |
-
--
|
| 314 |
-
--
|
| 315 |
-
--
|
| 316 |
-
|
| 317 |
-
|
| 318 |
-
|
| 319 |
-
|
| 320 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 321 |
body, .gradio-container {
|
| 322 |
background: var(--bg-0) !important;
|
| 323 |
-
font-family: '
|
| 324 |
color: var(--tx-1) !important;
|
| 325 |
min-height: 100vh;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 326 |
}
|
| 327 |
|
| 328 |
-
|
|
|
|
| 329 |
content: '';
|
| 330 |
-
position: fixed;
|
| 331 |
-
|
| 332 |
-
|
| 333 |
-
linear-gradient(rgba(201,169,110,0.025) 1px, transparent 1px),
|
| 334 |
-
linear-gradient(90deg, rgba(201,169,110,0.025) 1px, transparent 1px);
|
| 335 |
-
background-size: 48px 48px;
|
| 336 |
-
pointer-events: none;
|
| 337 |
-
z-index: 0;
|
| 338 |
}
|
| 339 |
|
| 340 |
-
/*
|
| 341 |
-
#
|
| 342 |
-
background: linear-gradient(160deg, #13161f 0%, #181c28 60%, #111420 100%);
|
| 343 |
-
border: 1px solid var(--border-hi);
|
| 344 |
-
border-radius: 20px;
|
| 345 |
-
padding: 52px 44px 40px;
|
| 346 |
-
text-align: center;
|
| 347 |
position: relative;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 348 |
overflow: hidden;
|
| 349 |
-
box-shadow: var(--sh-
|
| 350 |
-
margin-bottom:
|
| 351 |
}
|
| 352 |
|
| 353 |
-
#
|
| 354 |
content: '';
|
| 355 |
position: absolute;
|
| 356 |
-
top: -
|
| 357 |
-
|
| 358 |
-
|
| 359 |
-
|
| 360 |
-
pointer-events: none;
|
| 361 |
}
|
| 362 |
|
| 363 |
-
|
| 364 |
-
|
| 365 |
-
|
| 366 |
-
bottom: 0; left: 10%; right: 10%;
|
| 367 |
-
height: 1px;
|
| 368 |
-
background: linear-gradient(90deg, transparent, var(--border-hi), transparent);
|
| 369 |
-
}
|
| 370 |
-
|
| 371 |
-
.hdr-icon {
|
| 372 |
-
font-size: 2.8rem;
|
| 373 |
-
margin-bottom: 14px;
|
| 374 |
-
display: block;
|
| 375 |
-
filter: drop-shadow(0 0 18px rgba(201,169,110,0.4));
|
| 376 |
-
}
|
| 377 |
-
|
| 378 |
-
.hdr-title {
|
| 379 |
-
font-family: 'Playfair Display', serif !important;
|
| 380 |
-
font-size: 3rem !important;
|
| 381 |
-
font-weight: 700 !important;
|
| 382 |
-
color: var(--gold) !important;
|
| 383 |
-
letter-spacing: -1px;
|
| 384 |
-
line-height: 1.1;
|
| 385 |
-
margin: 0 0 12px !important;
|
| 386 |
-
text-shadow: 0 2px 32px rgba(201,169,110,0.25);
|
| 387 |
-
}
|
| 388 |
-
|
| 389 |
-
.hdr-sub {
|
| 390 |
-
font-family: 'DM Sans', sans-serif;
|
| 391 |
-
font-size: 1.02rem;
|
| 392 |
-
color: var(--tx-2);
|
| 393 |
-
font-weight: 300;
|
| 394 |
-
letter-spacing: 0.4px;
|
| 395 |
-
margin-bottom: 24px;
|
| 396 |
-
}
|
| 397 |
-
|
| 398 |
-
.badge-row {
|
| 399 |
-
display: flex;
|
| 400 |
-
gap: 8px;
|
| 401 |
-
justify-content: center;
|
| 402 |
-
flex-wrap: wrap;
|
| 403 |
-
margin-top: 6px;
|
| 404 |
-
}
|
| 405 |
-
|
| 406 |
-
.badge {
|
| 407 |
-
display: inline-flex;
|
| 408 |
-
align-items: center;
|
| 409 |
-
gap: 5px;
|
| 410 |
-
background: rgba(201,169,110,0.07);
|
| 411 |
-
border: 1px solid rgba(201,169,110,0.18);
|
| 412 |
-
border-radius: 99px;
|
| 413 |
-
padding: 5px 13px;
|
| 414 |
-
font-family: 'DM Mono', monospace;
|
| 415 |
-
font-size: 0.72rem;
|
| 416 |
-
color: var(--gold);
|
| 417 |
-
letter-spacing: 0.3px;
|
| 418 |
-
transition: background 0.2s;
|
| 419 |
-
}
|
| 420 |
-
|
| 421 |
-
.badge:hover { background: rgba(201,169,110,0.13); }
|
| 422 |
-
|
| 423 |
-
/* ββ PANEL CARDS βββββββββββββββββββββββββββ */
|
| 424 |
-
.gr-group {
|
| 425 |
-
background: var(--bg-2) !important;
|
| 426 |
-
border: 1px solid var(--border) !important;
|
| 427 |
-
border-radius: var(--r) !important;
|
| 428 |
-
padding: 26px 28px !important;
|
| 429 |
-
box-shadow: var(--sh) !important;
|
| 430 |
-
transition: border-color 0.25s;
|
| 431 |
-
position: relative;
|
| 432 |
}
|
| 433 |
|
| 434 |
-
|
| 435 |
-
|
|
|
|
|
|
|
| 436 |
}
|
| 437 |
|
| 438 |
-
|
| 439 |
-
.
|
| 440 |
-
|
| 441 |
-
|
| 442 |
-
|
| 443 |
-
|
| 444 |
-
|
| 445 |
-
|
| 446 |
-
|
| 447 |
-
|
| 448 |
-
|
| 449 |
-
|
|
|
|
| 450 |
}
|
| 451 |
|
| 452 |
-
.
|
| 453 |
-
content: '';
|
| 454 |
-
|
| 455 |
-
|
| 456 |
-
background: linear-gradient(90deg, var(--gold), transparent);
|
| 457 |
}
|
| 458 |
|
| 459 |
-
|
| 460 |
-
|
| 461 |
-
|
| 462 |
-
background: linear-gradient(90deg, var(--border), transparent);
|
| 463 |
}
|
| 464 |
|
| 465 |
-
|
| 466 |
-
|
| 467 |
-
font-
|
| 468 |
-
|
| 469 |
-
|
| 470 |
-
|
| 471 |
-
letter-spacing: 0.5px !important;
|
| 472 |
-
text-transform: uppercase !important;
|
| 473 |
}
|
| 474 |
|
| 475 |
-
|
| 476 |
-
|
| 477 |
-
|
| 478 |
-
|
| 479 |
-
|
| 480 |
-
|
| 481 |
-
font-size:
|
| 482 |
-
|
| 483 |
-
|
| 484 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 485 |
}
|
| 486 |
|
| 487 |
textarea:focus, input[type="text"]:focus {
|
| 488 |
-
border-color: var(--gold) !important;
|
| 489 |
-
|
| 490 |
-
outline: none !important;
|
| 491 |
}
|
| 492 |
|
| 493 |
textarea::placeholder, input::placeholder {
|
| 494 |
-
color: var(--tx-3) !important;
|
| 495 |
-
font-
|
| 496 |
}
|
| 497 |
|
| 498 |
select, .gr-dropdown select {
|
| 499 |
-
background: var(--bg-3) !important;
|
| 500 |
-
border:
|
| 501 |
-
|
| 502 |
-
|
| 503 |
-
font-family: 'DM Sans', sans-serif !important;
|
| 504 |
-
font-size: 0.88rem !important;
|
| 505 |
-
padding: 13px 16px !important;
|
| 506 |
-
transition: border-color 0.2s !important;
|
| 507 |
}
|
| 508 |
|
| 509 |
-
select:focus { border-color: var(--gold) !important; outline: none !important; }
|
| 510 |
|
| 511 |
-
/*
|
| 512 |
.gr-button {
|
| 513 |
-
font-family: '
|
| 514 |
-
font-
|
| 515 |
-
|
| 516 |
-
|
| 517 |
-
|
| 518 |
-
|
| 519 |
-
|
| 520 |
-
|
| 521 |
-
|
|
|
|
|
|
|
|
|
|
| 522 |
}
|
|
|
|
| 523 |
|
| 524 |
.gr-button-primary {
|
| 525 |
-
background: linear-gradient(135deg, #
|
| 526 |
-
color: #
|
| 527 |
-
box-shadow: 0 2px
|
| 528 |
}
|
| 529 |
|
| 530 |
.gr-button-primary:hover {
|
| 531 |
-
|
| 532 |
-
|
| 533 |
-
|
| 534 |
}
|
| 535 |
|
| 536 |
-
.gr-button-primary:active { transform: translateY(0) !important; }
|
| 537 |
|
| 538 |
.gr-button-secondary {
|
| 539 |
-
background: var(--bg-4) !important;
|
| 540 |
-
|
| 541 |
-
border: 1px solid var(--border-hi) !important;
|
| 542 |
}
|
| 543 |
|
| 544 |
.gr-button-secondary:hover {
|
| 545 |
-
border-color: var(--gold) !important;
|
| 546 |
-
|
| 547 |
-
|
| 548 |
-
transform: translateY(-1px) !important;
|
| 549 |
}
|
| 550 |
|
| 551 |
-
/*
|
| 552 |
#status-box .prose p, #status-box p {
|
| 553 |
-
font-family: '
|
| 554 |
-
|
| 555 |
-
|
| 556 |
-
|
| 557 |
-
|
| 558 |
-
border-radius: 0 var(--r-sm) var(--r-sm) 0 !important;
|
| 559 |
-
padding: 10px 16px !important;
|
| 560 |
-
margin: 0 !important;
|
| 561 |
-
}
|
| 562 |
-
|
| 563 |
-
/* ββ CHATBOT βββββββββββββββββββββββββββββββ */
|
| 564 |
-
.gr-chatbot {
|
| 565 |
-
background: var(--bg-1) !important;
|
| 566 |
-
border: 1px solid var(--border) !important;
|
| 567 |
-
border-radius: var(--r) !important;
|
| 568 |
-
padding: 12px !important;
|
| 569 |
-
}
|
| 570 |
-
|
| 571 |
-
/* ββ SUMMARY ββββββββββββββββββββββββββββββ */
|
| 572 |
-
#summary-out .prose {
|
| 573 |
-
background: var(--bg-3) !important;
|
| 574 |
-
border: 1px solid var(--border) !important;
|
| 575 |
-
border-radius: var(--r) !important;
|
| 576 |
-
padding: 22px 26px !important;
|
| 577 |
-
font-family: 'DM Sans', sans-serif !important;
|
| 578 |
-
font-size: 0.93rem !important;
|
| 579 |
-
line-height: 1.78 !important;
|
| 580 |
-
color: var(--tx-1) !important;
|
| 581 |
}
|
| 582 |
|
| 583 |
-
|
| 584 |
-
#summary-out
|
| 585 |
-
#summary-out
|
| 586 |
-
#summary-out
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 587 |
|
| 588 |
-
|
| 589 |
-
|
| 590 |
-
|
| 591 |
-
border:
|
| 592 |
-
|
| 593 |
}
|
| 594 |
|
| 595 |
-
|
| 596 |
-
|
| 597 |
-
|
| 598 |
-
font-family: 'DM Mono', monospace !important;
|
| 599 |
-
font-size: 0.7rem !important;
|
| 600 |
-
color: var(--tx-4) !important;
|
| 601 |
-
letter-spacing: 0.5px !important;
|
| 602 |
-
padding: 4px !important;
|
| 603 |
}
|
| 604 |
|
| 605 |
-
|
| 606 |
-
:
|
| 607 |
-
:
|
| 608 |
-
|
| 609 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 610 |
|
| 611 |
-
/*
|
| 612 |
-
|
| 613 |
-
|
| 614 |
-
|
|
|
|
| 615 |
}
|
| 616 |
|
| 617 |
-
|
| 618 |
-
|
| 619 |
-
|
|
|
|
|
|
|
|
|
|
| 620 |
}
|
| 621 |
|
| 622 |
-
.
|
| 623 |
-
.
|
| 624 |
-
.
|
| 625 |
-
|
| 626 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 627 |
"""
|
| 628 |
|
| 629 |
# =========================
|
| 630 |
# BUILD UI
|
| 631 |
# =========================
|
| 632 |
|
| 633 |
-
with gr.Blocks(title="
|
| 634 |
|
| 635 |
-
# βββ HEADER ββββββββββββββββββββββββββββββββββββββββββββββββββ
|
| 636 |
gr.HTML("""
|
| 637 |
-
<div id="
|
| 638 |
-
<
|
| 639 |
-
<div class="
|
| 640 |
-
<div class="
|
| 641 |
-
<div class="
|
| 642 |
-
|
| 643 |
-
|
| 644 |
-
|
| 645 |
-
|
| 646 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 647 |
</div>
|
| 648 |
</div>
|
| 649 |
""")
|
| 650 |
|
| 651 |
-
# βββ 01 LOAD PAPER βββββββββββββββββββββββββββββββββββββββββ
|
| 652 |
with gr.Group():
|
| 653 |
-
gr.HTML(
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 654 |
with gr.Row(equal_height=True):
|
| 655 |
arxiv_input = gr.Textbox(
|
| 656 |
label="Paper DOI",
|
| 657 |
-
placeholder="
|
| 658 |
scale=5,
|
| 659 |
)
|
| 660 |
-
load_btn = gr.Button("
|
| 661 |
-
|
| 662 |
status = gr.Markdown(
|
| 663 |
-
value="*
|
| 664 |
elem_id="status-box",
|
| 665 |
)
|
| 666 |
|
| 667 |
-
# βββ 02 SECTION SUMMARY ββ
|
| 668 |
with gr.Group():
|
| 669 |
-
gr.HTML(
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 670 |
with gr.Row(equal_height=True):
|
| 671 |
section_dropdown = gr.Dropdown(
|
| 672 |
-
label="Select Section",
|
| 673 |
-
choices=[],
|
| 674 |
-
scale=5,
|
| 675 |
-
interactive=True,
|
| 676 |
)
|
| 677 |
-
summarize_btn = gr.Button("
|
| 678 |
-
|
| 679 |
summary_output = gr.Markdown(
|
| 680 |
-
value="*Select a section
|
| 681 |
elem_id="summary-out",
|
| 682 |
)
|
| 683 |
|
| 684 |
-
# βββ 03 CHAT βββββββββββββββββββββββββββββββββββββββββββββββ
|
| 685 |
with gr.Group():
|
| 686 |
-
gr.HTML(
|
| 687 |
-
|
| 688 |
-
|
| 689 |
-
|
| 690 |
-
|
| 691 |
-
|
|
|
|
|
|
|
|
|
|
| 692 |
with gr.Row(equal_height=True):
|
| 693 |
msg = gr.Textbox(
|
| 694 |
-
label="
|
| 695 |
placeholder="What is the main contribution? Β· How does the method work? Β· What datasets were used?",
|
| 696 |
-
scale=5,
|
| 697 |
-
lines=1,
|
| 698 |
-
max_lines=3,
|
| 699 |
)
|
| 700 |
-
send_btn = gr.Button("Send
|
| 701 |
|
| 702 |
-
# βββ 04 VOICE ββββββββββββββββββββββββββββββββββββββββββββββ
|
| 703 |
with gr.Group():
|
| 704 |
-
gr.HTML('<div class="sec-label">04 Voice Query</div>')
|
| 705 |
gr.HTML("""
|
| 706 |
-
|
| 707 |
-
|
| 708 |
-
|
| 709 |
-
</
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 710 |
""")
|
| 711 |
with gr.Row(equal_height=True):
|
| 712 |
-
audio = gr.Audio(
|
| 713 |
-
|
| 714 |
-
label="Record or Upload Audio",
|
| 715 |
-
scale=5,
|
| 716 |
-
)
|
| 717 |
-
voice_btn = gr.Button("ποΈ Transcribe & Ask", variant="secondary", scale=1, min_width=160)
|
| 718 |
|
| 719 |
# βββ FOOTER βββββββββββββββββββββββββββββββββββββββββββββββββββββββ
|
| 720 |
-
gr.
|
| 721 |
-
|
| 722 |
-
|
| 723 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 724 |
|
| 725 |
# βββ BINDINGS βββββββββββββββββββββββββββββββββββββββββββββββββββββ
|
| 726 |
load_btn.click(load_paper, inputs=arxiv_input, outputs=[section_dropdown, status])
|
|
|
|
| 23 |
whisper_model = WhisperModel("base", compute_type="int8")
|
| 24 |
return whisper_model
|
| 25 |
|
| 26 |
+
GROQ_API_KEY = os.environ.get("GROQ_API_KEY", "")
|
| 27 |
if not GROQ_API_KEY:
|
| 28 |
+
raise ValueError("GROQ_API_KEY secret is not set. Add it in HF Space Settings β Secrets.")
|
| 29 |
|
| 30 |
client = Groq(api_key=GROQ_API_KEY)
|
| 31 |
MODEL_NAME = "llama-3.3-70b-versatile"
|
|
|
|
| 283 |
return history, ""
|
| 284 |
|
| 285 |
# =========================
|
| 286 |
+
# CSS β "Obsidian Intelligence" Premium 2026 Research Platform
|
| 287 |
+
# Ethos: High-Density Functionalism meets Dark Luxury
|
| 288 |
+
# Trends: Bento Grid Β· Glassmorphism Β· Kinetic borders Β· Layered depth
|
| 289 |
# =========================
|
| 290 |
|
| 291 |
CSS = """
|
| 292 |
+
@import url('https://fonts.googleapis.com/css2?family=Instrument+Serif:ital@0;1&family=Geist:wght@300;400;500;600;700&family=Geist+Mono:wght@400;500&display=swap');
|
| 293 |
|
| 294 |
+
/* βββββββββββ DESIGN TOKENS βββββββββββ */
|
| 295 |
:root {
|
| 296 |
+
--void: #07080c;
|
| 297 |
+
--bg-0: #0b0d13;
|
| 298 |
+
--bg-1: #0f1119;
|
| 299 |
+
--bg-2: #13161f;
|
| 300 |
+
--bg-3: #181c28;
|
| 301 |
+
--bg-4: #1e2333;
|
| 302 |
+
--bg-5: #242840;
|
| 303 |
+
--b-0: #1c2030;
|
| 304 |
+
--b-1: #252a3c;
|
| 305 |
+
--b-2: #303650;
|
| 306 |
+
--b-hi: #404868;
|
| 307 |
+
--gold: #d4a853;
|
| 308 |
+
--gold-lt: #e8c47a;
|
| 309 |
+
--gold-dk: #9e7535;
|
| 310 |
+
--gold-muted: rgba(212,168,83,0.08);
|
| 311 |
+
--gold-glow: rgba(212,168,83,0.16);
|
| 312 |
+
--gold-ring: 0 0 0 2.5px rgba(212,168,83,0.22);
|
| 313 |
+
--green: #3ecf8e;
|
| 314 |
+
--blue: #4d94ff;
|
| 315 |
+
--red: #f06565;
|
| 316 |
+
--amber: #f0a443;
|
| 317 |
+
--tx-1: #f0ece2;
|
| 318 |
+
--tx-2: #8a8578;
|
| 319 |
+
--tx-3: #4a4740;
|
| 320 |
+
--r-xs: 6px; --r-sm: 10px; --r: 16px; --r-lg: 22px; --r-xl: 28px;
|
| 321 |
+
--sh-sm: 0 2px 12px rgba(0,0,0,.4);
|
| 322 |
+
--sh: 0 4px 32px rgba(0,0,0,.55);
|
| 323 |
+
--sh-lg: 0 8px 64px rgba(0,0,0,.7);
|
| 324 |
+
--sh-xl: 0 16px 80px rgba(0,0,0,.8);
|
| 325 |
+
--sh-gold: 0 4px 28px rgba(212,168,83,0.2);
|
| 326 |
+
}
|
| 327 |
+
|
| 328 |
+
*, *::before, *::after { box-sizing: border-box; margin: 0; }
|
| 329 |
+
html { scroll-behavior: smooth; }
|
| 330 |
+
|
| 331 |
body, .gradio-container {
|
| 332 |
background: var(--bg-0) !important;
|
| 333 |
+
font-family: 'Geist', system-ui, sans-serif !important;
|
| 334 |
color: var(--tx-1) !important;
|
| 335 |
min-height: 100vh;
|
| 336 |
+
-webkit-font-smoothing: antialiased;
|
| 337 |
+
}
|
| 338 |
+
|
| 339 |
+
/* Dot-matrix background */
|
| 340 |
+
.gradio-container {
|
| 341 |
+
background-image: radial-gradient(circle, rgba(212,168,83,0.05) 1px, transparent 1px) !important;
|
| 342 |
+
background-size: 28px 28px !important;
|
| 343 |
+
background-attachment: fixed !important;
|
| 344 |
}
|
| 345 |
|
| 346 |
+
/* Vignette overlay */
|
| 347 |
+
.gradio-container::before {
|
| 348 |
content: '';
|
| 349 |
+
position: fixed; inset: 0;
|
| 350 |
+
background: radial-gradient(ellipse 80% 60% at 50% 0%, transparent 40%, rgba(7,8,12,0.75) 100%);
|
| 351 |
+
pointer-events: none; z-index: 0;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 352 |
}
|
| 353 |
|
| 354 |
+
/* βββββββββββ HERO HEADER βββββββββββ */
|
| 355 |
+
#hero {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 356 |
position: relative;
|
| 357 |
+
background: linear-gradient(145deg, #0f1220 0%, #131828 45%, #0c0f1a 100%);
|
| 358 |
+
border: 1px solid var(--b-2);
|
| 359 |
+
border-radius: var(--r-xl);
|
| 360 |
+
padding: 56px 48px 44px;
|
| 361 |
+
text-align: center;
|
| 362 |
overflow: hidden;
|
| 363 |
+
box-shadow: var(--sh-xl);
|
| 364 |
+
margin-bottom: 2px;
|
| 365 |
}
|
| 366 |
|
| 367 |
+
#hero::before {
|
| 368 |
content: '';
|
| 369 |
position: absolute;
|
| 370 |
+
top: -120px; left: 50%; transform: translateX(-50%);
|
| 371 |
+
width: 600px; height: 400px;
|
| 372 |
+
background: conic-gradient(from 180deg at 50% 50%, rgba(212,168,83,0) 0deg, rgba(212,168,83,0.07) 60deg, rgba(77,148,255,0.04) 120deg, rgba(212,168,83,0) 180deg, rgba(212,168,83,0.06) 240deg, rgba(77,148,255,0.03) 300deg, rgba(212,168,83,0) 360deg);
|
| 373 |
+
animation: aurora 12s linear infinite;
|
| 374 |
+
pointer-events: none; border-radius: 50%;
|
| 375 |
}
|
| 376 |
|
| 377 |
+
@keyframes aurora {
|
| 378 |
+
from { transform: translateX(-50%) rotate(0deg); }
|
| 379 |
+
to { transform: translateX(-50%) rotate(360deg); }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 380 |
}
|
| 381 |
|
| 382 |
+
#hero::after {
|
| 383 |
+
content: ''; position: absolute;
|
| 384 |
+
bottom: 0; left: 8%; right: 8%; height: 1px;
|
| 385 |
+
background: linear-gradient(90deg, transparent, var(--b-2) 30%, var(--b-hi) 50%, var(--b-2) 70%, transparent);
|
| 386 |
}
|
| 387 |
|
| 388 |
+
.hero-corner { position: absolute; width: 36px; height: 36px; opacity: 0.35; }
|
| 389 |
+
.hero-corner-tl { top: 18px; left: 18px; border-top: 1.5px solid var(--gold); border-left: 1.5px solid var(--gold); border-radius: 4px 0 0 0; }
|
| 390 |
+
.hero-corner-tr { top: 18px; right: 18px; border-top: 1.5px solid var(--gold); border-right: 1.5px solid var(--gold); border-radius: 0 4px 0 0; }
|
| 391 |
+
.hero-corner-bl { bottom: 18px; left: 18px; border-bottom: 1.5px solid var(--gold); border-left: 1.5px solid var(--gold); border-radius: 0 0 0 4px; }
|
| 392 |
+
.hero-corner-br { bottom: 18px; right: 18px; border-bottom: 1.5px solid var(--gold); border-right: 1.5px solid var(--gold); border-radius: 0 0 4px 0; }
|
| 393 |
+
|
| 394 |
+
.hero-eyebrow {
|
| 395 |
+
display: inline-flex; align-items: center; gap: 8px;
|
| 396 |
+
background: rgba(212,168,83,0.07); border: 1px solid rgba(212,168,83,0.2);
|
| 397 |
+
border-radius: 99px; padding: 5px 14px;
|
| 398 |
+
font-family: 'Geist Mono', monospace; font-size: 0.67rem;
|
| 399 |
+
color: var(--gold); letter-spacing: 2px; text-transform: uppercase;
|
| 400 |
+
margin-bottom: 20px; animation: fadeDown 0.6s ease both;
|
| 401 |
}
|
| 402 |
|
| 403 |
+
.hero-eyebrow::before {
|
| 404 |
+
content: ''; width: 5px; height: 5px; background: var(--gold);
|
| 405 |
+
border-radius: 50%; box-shadow: 0 0 6px var(--gold);
|
| 406 |
+
animation: pulse-dot 2s ease-in-out infinite;
|
|
|
|
| 407 |
}
|
| 408 |
|
| 409 |
+
@keyframes pulse-dot {
|
| 410 |
+
0%, 100% { opacity: 1; transform: scale(1); }
|
| 411 |
+
50% { opacity: 0.4; transform: scale(0.65); }
|
|
|
|
| 412 |
}
|
| 413 |
|
| 414 |
+
.hero-title {
|
| 415 |
+
font-family: 'Instrument Serif', Georgia, serif !important;
|
| 416 |
+
font-size: 3.4rem !important; font-weight: 400 !important;
|
| 417 |
+
color: var(--tx-1) !important; letter-spacing: -1.5px;
|
| 418 |
+
line-height: 1.05; margin-bottom: 16px !important;
|
| 419 |
+
animation: fadeDown 0.6s 0.1s ease both;
|
|
|
|
|
|
|
| 420 |
}
|
| 421 |
|
| 422 |
+
.hero-title em {
|
| 423 |
+
font-style: italic; color: var(--gold);
|
| 424 |
+
text-shadow: 0 0 40px rgba(212,168,83,0.3);
|
| 425 |
+
}
|
| 426 |
+
|
| 427 |
+
.hero-sub {
|
| 428 |
+
font-size: 1rem; color: var(--tx-2); font-weight: 300;
|
| 429 |
+
letter-spacing: 0.2px; max-width: 560px; margin: 0 auto 28px;
|
| 430 |
+
line-height: 1.6; animation: fadeDown 0.6s 0.2s ease both;
|
| 431 |
+
}
|
| 432 |
+
|
| 433 |
+
.pill-row {
|
| 434 |
+
display: flex; gap: 8px; justify-content: center;
|
| 435 |
+
flex-wrap: wrap; animation: fadeDown 0.6s 0.3s ease both;
|
| 436 |
+
}
|
| 437 |
+
|
| 438 |
+
.pill {
|
| 439 |
+
display: inline-flex; align-items: center; gap: 6px;
|
| 440 |
+
background: rgba(255,255,255,0.03); border: 1px solid var(--b-2);
|
| 441 |
+
border-radius: 99px; padding: 6px 14px;
|
| 442 |
+
font-size: 0.76rem; font-weight: 500;
|
| 443 |
+
color: var(--tx-2); letter-spacing: 0.2px;
|
| 444 |
+
transition: all 0.2s; cursor: default;
|
| 445 |
+
}
|
| 446 |
+
|
| 447 |
+
.pill:hover { border-color: var(--gold); color: var(--gold-lt); background: var(--gold-muted); transform: translateY(-1px); }
|
| 448 |
+
.pill-dot { width: 5px; height: 5px; border-radius: 50%; flex-shrink: 0; }
|
| 449 |
+
|
| 450 |
+
/* βββββββββββ PANEL CARDS βββββββββββ */
|
| 451 |
+
.gr-group {
|
| 452 |
+
background: rgba(19,22,31,0.88) !important;
|
| 453 |
+
backdrop-filter: blur(20px) saturate(140%) !important;
|
| 454 |
+
-webkit-backdrop-filter: blur(20px) saturate(140%) !important;
|
| 455 |
+
border: 1px solid var(--b-1) !important;
|
| 456 |
+
border-radius: var(--r-lg) !important;
|
| 457 |
+
padding: 28px 32px !important;
|
| 458 |
+
box-shadow: var(--sh) !important;
|
| 459 |
+
transition: border-color 0.3s, box-shadow 0.3s !important;
|
| 460 |
+
position: relative; overflow: hidden;
|
| 461 |
+
}
|
| 462 |
+
|
| 463 |
+
.gr-group::before {
|
| 464 |
+
content: ''; position: absolute;
|
| 465 |
+
top: 0; left: 0; right: 0; height: 1px;
|
| 466 |
+
background: linear-gradient(90deg, transparent, rgba(255,255,255,0.05) 40%, rgba(255,255,255,0.05) 60%, transparent);
|
| 467 |
+
pointer-events: none;
|
| 468 |
+
}
|
| 469 |
+
|
| 470 |
+
.gr-group:hover { border-color: var(--b-2) !important; box-shadow: var(--sh-lg) !important; }
|
| 471 |
+
|
| 472 |
+
/* βββββββββββ STEP HEADERS βββββββββββ */
|
| 473 |
+
.step-header { display: flex; align-items: center; gap: 14px; margin-bottom: 20px; }
|
| 474 |
+
|
| 475 |
+
.step-num {
|
| 476 |
+
width: 30px; height: 30px; background: var(--gold-muted);
|
| 477 |
+
border: 1px solid rgba(212,168,83,0.25); border-radius: 8px;
|
| 478 |
+
display: flex; align-items: center; justify-content: center;
|
| 479 |
+
font-family: 'Geist Mono', monospace; font-size: 0.72rem;
|
| 480 |
+
font-weight: 500; color: var(--gold); flex-shrink: 0;
|
| 481 |
+
}
|
| 482 |
+
|
| 483 |
+
.step-title { font-size: 0.95rem; font-weight: 600; color: var(--tx-1); letter-spacing: -0.2px; }
|
| 484 |
+
.step-desc { font-size: 0.76rem; color: var(--tx-3); margin-left: auto; }
|
| 485 |
+
.step-divider { height: 1px; background: linear-gradient(90deg, var(--b-1), transparent); margin-bottom: 20px; }
|
| 486 |
+
|
| 487 |
+
/* βββββββββββ FORM CONTROLS βββββββββββ */
|
| 488 |
+
label span, .block label span {
|
| 489 |
+
font-family: 'Geist', sans-serif !important; font-size: 0.73rem !important;
|
| 490 |
+
font-weight: 600 !important; color: var(--tx-3) !important;
|
| 491 |
+
letter-spacing: 0.8px !important; text-transform: uppercase !important;
|
| 492 |
+
}
|
| 493 |
+
|
| 494 |
+
textarea, input[type="text"], .gr-textbox textarea, .gr-textbox input {
|
| 495 |
+
background: var(--bg-3) !important; border: 1px solid var(--b-1) !important;
|
| 496 |
+
border-radius: var(--r-sm) !important; color: var(--tx-1) !important;
|
| 497 |
+
font-family: 'Geist Mono', monospace !important; font-size: 0.88rem !important;
|
| 498 |
+
padding: 14px 18px !important;
|
| 499 |
+
transition: border-color 0.2s, box-shadow 0.2s, background 0.2s !important;
|
| 500 |
+
resize: none !important; line-height: 1.5 !important;
|
| 501 |
}
|
| 502 |
|
| 503 |
textarea:focus, input[type="text"]:focus {
|
| 504 |
+
border-color: var(--gold) !important; box-shadow: var(--gold-ring) !important;
|
| 505 |
+
background: var(--bg-4) !important; outline: none !important;
|
|
|
|
| 506 |
}
|
| 507 |
|
| 508 |
textarea::placeholder, input::placeholder {
|
| 509 |
+
color: var(--tx-3) !important; font-style: italic;
|
| 510 |
+
font-family: 'Geist', sans-serif !important; font-size: 0.84rem !important;
|
| 511 |
}
|
| 512 |
|
| 513 |
select, .gr-dropdown select {
|
| 514 |
+
background: var(--bg-3) !important; border: 1px solid var(--b-1) !important;
|
| 515 |
+
border-radius: var(--r-sm) !important; color: var(--tx-1) !important;
|
| 516 |
+
font-family: 'Geist', sans-serif !important; font-size: 0.88rem !important;
|
| 517 |
+
padding: 14px 18px !important; transition: border-color 0.2s, box-shadow 0.2s !important;
|
|
|
|
|
|
|
|
|
|
|
|
|
| 518 |
}
|
| 519 |
|
| 520 |
+
select:focus { border-color: var(--gold) !important; box-shadow: var(--gold-ring) !important; outline: none !important; }
|
| 521 |
|
| 522 |
+
/* βββββββββββ BUTTONS βββββββββββ */
|
| 523 |
.gr-button {
|
| 524 |
+
font-family: 'Geist', sans-serif !important; font-size: 0.85rem !important;
|
| 525 |
+
font-weight: 600 !important; letter-spacing: 0.1px !important;
|
| 526 |
+
border-radius: var(--r-sm) !important; cursor: pointer !important;
|
| 527 |
+
transition: all 0.18s cubic-bezier(0.34, 1.56, 0.64, 1) !important;
|
| 528 |
+
padding: 13px 24px !important; position: relative; overflow: hidden;
|
| 529 |
+
}
|
| 530 |
+
|
| 531 |
+
.gr-button-primary::after {
|
| 532 |
+
content: ''; position: absolute;
|
| 533 |
+
top: 0; left: -100%; width: 100%; height: 100%;
|
| 534 |
+
background: linear-gradient(90deg, transparent, rgba(255,255,255,0.12), transparent);
|
| 535 |
+
transition: left 0.45s ease;
|
| 536 |
}
|
| 537 |
+
.gr-button-primary:hover::after { left: 100%; }
|
| 538 |
|
| 539 |
.gr-button-primary {
|
| 540 |
+
background: linear-gradient(135deg, #d4a853 0%, #b8893a 60%, #9e7535 100%) !important;
|
| 541 |
+
color: #070810 !important; border: none !important;
|
| 542 |
+
box-shadow: 0 2px 16px rgba(212,168,83,0.3), inset 0 1px 0 rgba(255,255,255,0.15) !important;
|
| 543 |
}
|
| 544 |
|
| 545 |
.gr-button-primary:hover {
|
| 546 |
+
transform: translateY(-2px) scale(1.01) !important;
|
| 547 |
+
box-shadow: 0 8px 28px rgba(212,168,83,0.42), inset 0 1px 0 rgba(255,255,255,0.2) !important;
|
| 548 |
+
filter: brightness(1.06) !important;
|
| 549 |
}
|
| 550 |
|
| 551 |
+
.gr-button-primary:active { transform: translateY(0) scale(0.99) !important; }
|
| 552 |
|
| 553 |
.gr-button-secondary {
|
| 554 |
+
background: var(--bg-4) !important; color: var(--tx-2) !important;
|
| 555 |
+
border: 1px solid var(--b-2) !important;
|
|
|
|
| 556 |
}
|
| 557 |
|
| 558 |
.gr-button-secondary:hover {
|
| 559 |
+
border-color: var(--gold) !important; color: var(--gold-lt) !important;
|
| 560 |
+
background: var(--gold-muted) !important; transform: translateY(-1px) !important;
|
| 561 |
+
box-shadow: var(--sh-gold) !important;
|
|
|
|
| 562 |
}
|
| 563 |
|
| 564 |
+
/* βββββββββββ STATUS BOX βββββββββββ */
|
| 565 |
#status-box .prose p, #status-box p {
|
| 566 |
+
font-family: 'Geist Mono', monospace !important; font-size: 0.8rem !important;
|
| 567 |
+
color: var(--tx-2) !important; background: var(--bg-3) !important;
|
| 568 |
+
border: 1px solid var(--b-1) !important; border-left: 3px solid var(--gold) !important;
|
| 569 |
+
border-radius: 0 var(--r-xs) var(--r-xs) 0 !important;
|
| 570 |
+
padding: 11px 16px !important; margin: 0 !important; line-height: 1.55 !important;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 571 |
}
|
| 572 |
|
| 573 |
+
/* βββββββββββ SUMMARY OUTPUT βββββββββββ */
|
| 574 |
+
#summary-out .prose strong, #summary-out strong { color: var(--gold-lt) !important; font-weight: 600 !important; }
|
| 575 |
+
#summary-out .prose p { margin-bottom: 10px !important; }
|
| 576 |
+
#summary-out .prose ul { padding-left: 20px !important; }
|
| 577 |
+
#summary-out .prose li { margin-bottom: 5px !important; color: var(--tx-1) !important; }
|
| 578 |
+
#summary-out .prose em { color: var(--tx-2) !important; }
|
| 579 |
+
|
| 580 |
+
/* βββββββββββ CHATBOT βββββββββββ */
|
| 581 |
+
.gr-chatbot, [data-testid="chatbot"] {
|
| 582 |
+
background: var(--bg-1) !important; border: 1px solid var(--b-1) !important;
|
| 583 |
+
border-radius: var(--r) !important; padding: 12px !important;
|
| 584 |
+
}
|
| 585 |
|
| 586 |
+
.gr-chatbot .message {
|
| 587 |
+
font-family: 'Geist', sans-serif !important; font-size: 0.9rem !important;
|
| 588 |
+
line-height: 1.7 !important; padding: 13px 18px !important;
|
| 589 |
+
border-radius: 12px !important; max-width: 82% !important;
|
| 590 |
+
animation: msgIn 0.25s cubic-bezier(0.34,1.56,0.64,1) both;
|
| 591 |
}
|
| 592 |
|
| 593 |
+
@keyframes msgIn {
|
| 594 |
+
from { opacity: 0; transform: translateY(8px) scale(0.97); }
|
| 595 |
+
to { opacity: 1; transform: translateY(0) scale(1); }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 596 |
}
|
| 597 |
|
| 598 |
+
.gr-chatbot .message.user {
|
| 599 |
+
background: linear-gradient(135deg, var(--bg-4), var(--bg-5)) !important;
|
| 600 |
+
border: 1px solid var(--b-2) !important; color: var(--tx-1) !important; margin-left: auto !important;
|
| 601 |
+
}
|
| 602 |
+
|
| 603 |
+
.gr-chatbot .message.bot {
|
| 604 |
+
background: var(--bg-2) !important; border: 1px solid var(--b-1) !important; color: var(--tx-1) !important;
|
| 605 |
+
}
|
| 606 |
+
|
| 607 |
+
/* βββββββββββ AUDIO βββββββββββ */
|
| 608 |
+
.gr-audio, [data-testid="audio"] {
|
| 609 |
+
background: var(--bg-3) !important; border: 1px solid var(--b-1) !important;
|
| 610 |
+
border-radius: var(--r-sm) !important; padding: 8px !important;
|
| 611 |
+
}
|
| 612 |
|
| 613 |
+
/* βββββββββββ VOICE DESC βββββββββββ */
|
| 614 |
+
.voice-desc {
|
| 615 |
+
font-size: 0.84rem; color: var(--tx-2); margin: 0 0 16px; line-height: 1.6;
|
| 616 |
+
padding: 10px 14px; background: var(--bg-3); border-radius: var(--r-xs);
|
| 617 |
+
border-left: 2px solid var(--b-2);
|
| 618 |
}
|
| 619 |
|
| 620 |
+
/* βββββββββββ FOOTER βββββββββββ */
|
| 621 |
+
#footer-bar {
|
| 622 |
+
display: flex; align-items: center; justify-content: space-between;
|
| 623 |
+
padding: 14px 20px; background: rgba(15,17,25,0.6);
|
| 624 |
+
border: 1px solid var(--b-0); border-radius: var(--r); margin-top: 4px;
|
| 625 |
+
flex-wrap: wrap; gap: 10px;
|
| 626 |
}
|
| 627 |
|
| 628 |
+
.footer-copy { font-family: 'Geist Mono', monospace; font-size: 0.68rem; color: var(--tx-3); }
|
| 629 |
+
.footer-stack { display: flex; gap: 6px; flex-wrap: wrap; }
|
| 630 |
+
.footer-tag {
|
| 631 |
+
font-family: 'Geist Mono', monospace; font-size: 0.64rem; color: var(--tx-3);
|
| 632 |
+
background: var(--bg-2); border: 1px solid var(--b-0); border-radius: 4px; padding: 2px 7px;
|
| 633 |
+
}
|
| 634 |
+
|
| 635 |
+
/* βββββββββββ SCROLLBAR βββββββββββ */
|
| 636 |
+
::-webkit-scrollbar { width: 4px; height: 4px; }
|
| 637 |
+
::-webkit-scrollbar-track { background: transparent; }
|
| 638 |
+
::-webkit-scrollbar-thumb { background: var(--b-2); border-radius: 99px; }
|
| 639 |
+
::-webkit-scrollbar-thumb:hover { background: var(--gold-dk); }
|
| 640 |
+
|
| 641 |
+
/* βββββββββββ ANIMATIONS βββββββββββ */
|
| 642 |
+
@keyframes fadeDown { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; transform: translateY(0); } }
|
| 643 |
+
@keyframes fadeUp { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: translateY(0); } }
|
| 644 |
+
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
|
| 645 |
+
|
| 646 |
+
.gradio-container .gr-group { animation: fadeUp 0.5s cubic-bezier(0.22, 1, 0.36, 1) both; }
|
| 647 |
+
|
| 648 |
+
::selection { background: rgba(212,168,83,0.25); color: var(--tx-1); }
|
| 649 |
"""
|
| 650 |
|
| 651 |
# =========================
|
| 652 |
# BUILD UI
|
| 653 |
# =========================
|
| 654 |
|
| 655 |
+
with gr.Blocks(title="Research Intelligence Platform") as demo:
|
| 656 |
|
| 657 |
+
# βββ HERO HEADER ββββββββββββββββββββββββββββββββββββββββββββββββββ
|
| 658 |
gr.HTML("""
|
| 659 |
+
<div id="hero">
|
| 660 |
+
<div class="hero-corner hero-corner-tl"></div>
|
| 661 |
+
<div class="hero-corner hero-corner-tr"></div>
|
| 662 |
+
<div class="hero-corner hero-corner-bl"></div>
|
| 663 |
+
<div class="hero-corner hero-corner-br"></div>
|
| 664 |
+
|
| 665 |
+
<div class="hero-eyebrow">Research Intelligence Platform</div>
|
| 666 |
+
|
| 667 |
+
<div class="hero-title">Your <em>AI Research</em> Partner</div>
|
| 668 |
+
|
| 669 |
+
<div class="hero-sub">
|
| 670 |
+
Paste any paper DOI β instantly fetch, index, summarize, and interrogate
|
| 671 |
+
research literature with LLaMA 3.3 and semantic search.
|
| 672 |
+
</div>
|
| 673 |
+
|
| 674 |
+
<div class="pill-row">
|
| 675 |
+
<span class="pill"><span class="pill-dot" style="background:#3ecf8e"></span>RAG Architecture</span>
|
| 676 |
+
<span class="pill"><span class="pill-dot" style="background:#d4a853"></span>LLaMA 3.3 Β· 70B</span>
|
| 677 |
+
<span class="pill"><span class="pill-dot" style="background:#4d94ff"></span>Whisper ASR</span>
|
| 678 |
+
<span class="pill"><span class="pill-dot" style="background:#f0a443"></span>FAISS Semantic Index</span>
|
| 679 |
+
<span class="pill"><span class="pill-dot" style="background:#c084fc"></span>DOI Resolver</span>
|
| 680 |
</div>
|
| 681 |
</div>
|
| 682 |
""")
|
| 683 |
|
| 684 |
+
# βββ STEP 01 β LOAD PAPER βββββββββββββββββββββββββββββββββββββββββ
|
| 685 |
with gr.Group():
|
| 686 |
+
gr.HTML("""
|
| 687 |
+
<div class="step-header">
|
| 688 |
+
<div class="step-num">01</div>
|
| 689 |
+
<div><div class="step-title">Load Paper</div></div>
|
| 690 |
+
<div class="step-desc">Paste DOI → fetch → index</div>
|
| 691 |
+
</div>
|
| 692 |
+
<div class="step-divider"></div>
|
| 693 |
+
""")
|
| 694 |
with gr.Row(equal_height=True):
|
| 695 |
arxiv_input = gr.Textbox(
|
| 696 |
label="Paper DOI",
|
| 697 |
+
placeholder="10.1038/s41586-021-03819-2 Β· https://doi.org/10.48550/arXiv.1706.03762",
|
| 698 |
scale=5,
|
| 699 |
)
|
| 700 |
+
load_btn = gr.Button("Load Paper β", variant="primary", scale=1, min_width=160)
|
|
|
|
| 701 |
status = gr.Markdown(
|
| 702 |
+
value="*Paste a DOI above and click **Load Paper** β the full text will be fetched and indexed automatically.*",
|
| 703 |
elem_id="status-box",
|
| 704 |
)
|
| 705 |
|
| 706 |
+
# βββ STEP 02 β SECTION SUMMARY ββββββββββββββββββββββββββββββββββββ
|
| 707 |
with gr.Group():
|
| 708 |
+
gr.HTML("""
|
| 709 |
+
<div class="step-header">
|
| 710 |
+
<div class="step-num">02</div>
|
| 711 |
+
<div><div class="step-title">Section Summary</div></div>
|
| 712 |
+
<div class="step-desc">AI-powered breakdown</div>
|
| 713 |
+
</div>
|
| 714 |
+
<div class="step-divider"></div>
|
| 715 |
+
""")
|
| 716 |
with gr.Row(equal_height=True):
|
| 717 |
section_dropdown = gr.Dropdown(
|
| 718 |
+
label="Select Section", choices=[], scale=5, interactive=True,
|
|
|
|
|
|
|
|
|
|
| 719 |
)
|
| 720 |
+
summarize_btn = gr.Button("β¦ Summarize", variant="secondary", scale=1, min_width=150)
|
|
|
|
| 721 |
summary_output = gr.Markdown(
|
| 722 |
+
value="*Select a section from the dropdown, then click **Summarize** for a structured AI breakdown.*",
|
| 723 |
elem_id="summary-out",
|
| 724 |
)
|
| 725 |
|
| 726 |
+
# βββ STEP 03 β CHAT βββββββββββββββββββββββββββββββββββββββββββββββ
|
| 727 |
with gr.Group():
|
| 728 |
+
gr.HTML("""
|
| 729 |
+
<div class="step-header">
|
| 730 |
+
<div class="step-num">03</div>
|
| 731 |
+
<div><div class="step-title">Chat with Paper</div></div>
|
| 732 |
+
<div class="step-desc">Context-aware Q&A</div>
|
| 733 |
+
</div>
|
| 734 |
+
<div class="step-divider"></div>
|
| 735 |
+
""")
|
| 736 |
+
chatbot = gr.Chatbot(value=[], height=440, show_label=False)
|
| 737 |
with gr.Row(equal_height=True):
|
| 738 |
msg = gr.Textbox(
|
| 739 |
+
label="Ask a Question",
|
| 740 |
placeholder="What is the main contribution? Β· How does the method work? Β· What datasets were used?",
|
| 741 |
+
scale=5, lines=1, max_lines=4,
|
|
|
|
|
|
|
| 742 |
)
|
| 743 |
+
send_btn = gr.Button("Send β", variant="primary", scale=1, min_width=120)
|
| 744 |
|
| 745 |
+
# βββ STEP 04 β VOICE ββββββββββββββββββββββββββββββββββββββββββββββ
|
| 746 |
with gr.Group():
|
|
|
|
| 747 |
gr.HTML("""
|
| 748 |
+
<div class="step-header">
|
| 749 |
+
<div class="step-num">04</div>
|
| 750 |
+
<div><div class="step-title">Voice Query</div></div>
|
| 751 |
+
<div class="step-desc">Speak → transcribe → search</div>
|
| 752 |
+
</div>
|
| 753 |
+
<div class="step-divider"></div>
|
| 754 |
+
<p class="voice-desc">
|
| 755 |
+
Record or upload an audio question β Whisper ASR transcribes it and runs semantic search automatically.
|
| 756 |
+
</p>
|
| 757 |
""")
|
| 758 |
with gr.Row(equal_height=True):
|
| 759 |
+
audio = gr.Audio(type="filepath", label="Record or Upload Audio", scale=5)
|
| 760 |
+
voice_btn = gr.Button("π Transcribe & Ask", variant="secondary", scale=1, min_width=170)
|
|
|
|
|
|
|
|
|
|
|
|
|
| 761 |
|
| 762 |
# βββ FOOTER βββββββββββββββββββββββββββββββββββββββββββββββββββββββ
|
| 763 |
+
gr.HTML("""
|
| 764 |
+
<div id="footer-bar">
|
| 765 |
+
<span class="footer-copy">Research Intelligence Platform · 2026</span>
|
| 766 |
+
<div class="footer-stack">
|
| 767 |
+
<span class="footer-tag">Gradio</span>
|
| 768 |
+
<span class="footer-tag">Groq LLaMA 3.3</span>
|
| 769 |
+
<span class="footer-tag">FAISS</span>
|
| 770 |
+
<span class="footer-tag">Sentence Transformers</span>
|
| 771 |
+
<span class="footer-tag">faster-whisper</span>
|
| 772 |
+
<span class="footer-tag">PyMuPDF</span>
|
| 773 |
+
<span class="footer-tag">Unpaywall</span>
|
| 774 |
+
</div>
|
| 775 |
+
</div>
|
| 776 |
+
""")
|
| 777 |
|
| 778 |
# βββ BINDINGS βββββββββββββββββββββββββββββββββββββββββββββββββββββ
|
| 779 |
load_btn.click(load_paper, inputs=arxiv_input, outputs=[section_dropdown, status])
|