Spaces:
Runtime error
Runtime error
sdad
Browse files
app.py
CHANGED
|
@@ -454,6 +454,23 @@ html, body {
|
|
| 454 |
font-weight: 500;
|
| 455 |
}
|
| 456 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 457 |
/* Footer */
|
| 458 |
.footer {
|
| 459 |
text-align: center;
|
|
@@ -520,12 +537,14 @@ html, body {
|
|
| 520 |
overflow-x: auto !important;
|
| 521 |
color: #e0e0e0 !important;
|
| 522 |
border: 1px solid #333333 !important;
|
|
|
|
| 523 |
}
|
| 524 |
|
| 525 |
.gr-markdown pre code {
|
| 526 |
background-color: transparent !important;
|
| 527 |
padding: 0 !important;
|
| 528 |
color: inherit !important;
|
|
|
|
| 529 |
}
|
| 530 |
|
| 531 |
.gr-markdown blockquote {
|
|
@@ -555,6 +574,49 @@ html, body {
|
|
| 555 |
color: #ffffff !important;
|
| 556 |
}
|
| 557 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 558 |
/* Spinner Animation */
|
| 559 |
@keyframes spin {
|
| 560 |
0% { transform: rotate(0deg); }
|
|
@@ -594,7 +656,15 @@ def research_assistant(query, file, use_ddg, progress=gr.Progress()):
|
|
| 594 |
yield step
|
| 595 |
|
| 596 |
# Create Gradio interface
|
| 597 |
-
with gr.Blocks(
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 598 |
gr.Markdown(f"""
|
| 599 |
<div class="header">
|
| 600 |
<h1 class="title">🧠 AI Research Assistant</h1>
|
|
@@ -625,9 +695,18 @@ with gr.Blocks(css=custom_css, title="Research Assistant") as demo:
|
|
| 625 |
with gr.Column(scale=2):
|
| 626 |
with gr.Group(elem_classes=["card", "output-section"]):
|
| 627 |
gr.Markdown("### 📊 Analysis Results")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 628 |
output = gr.Markdown(elem_classes=["streaming-content"], visible=True)
|
| 629 |
status_indicator = gr.HTML("""
|
| 630 |
<div class="status-indicator">
|
|
|
|
| 631 |
<span class="progress-text">Ready for your research query</span>
|
| 632 |
</div>
|
| 633 |
""")
|
|
|
|
| 454 |
font-weight: 500;
|
| 455 |
}
|
| 456 |
|
| 457 |
+
/* Progress Bar */
|
| 458 |
+
.progress-container {
|
| 459 |
+
width: 100%;
|
| 460 |
+
height: 6px;
|
| 461 |
+
background-color: #333333;
|
| 462 |
+
border-radius: 3px;
|
| 463 |
+
margin: 15px 0;
|
| 464 |
+
overflow: hidden;
|
| 465 |
+
}
|
| 466 |
+
|
| 467 |
+
.progress-bar {
|
| 468 |
+
height: 100%;
|
| 469 |
+
background: linear-gradient(90deg, #00ffff, #0099cc);
|
| 470 |
+
width: 0%;
|
| 471 |
+
transition: width 0.3s ease;
|
| 472 |
+
}
|
| 473 |
+
|
| 474 |
/* Footer */
|
| 475 |
.footer {
|
| 476 |
text-align: center;
|
|
|
|
| 537 |
overflow-x: auto !important;
|
| 538 |
color: #e0e0e0 !important;
|
| 539 |
border: 1px solid #333333 !important;
|
| 540 |
+
margin: 15px 0 !important;
|
| 541 |
}
|
| 542 |
|
| 543 |
.gr-markdown pre code {
|
| 544 |
background-color: transparent !important;
|
| 545 |
padding: 0 !important;
|
| 546 |
color: inherit !important;
|
| 547 |
+
font-size: 0.95em !important;
|
| 548 |
}
|
| 549 |
|
| 550 |
.gr-markdown blockquote {
|
|
|
|
| 574 |
color: #ffffff !important;
|
| 575 |
}
|
| 576 |
|
| 577 |
+
/* Code syntax highlighting */
|
| 578 |
+
.gr-markdown pre code.hljs {
|
| 579 |
+
display: block;
|
| 580 |
+
overflow-x: auto;
|
| 581 |
+
padding: 1em;
|
| 582 |
+
background: #1e1e2e !important;
|
| 583 |
+
color: #dcdcdc !important;
|
| 584 |
+
font-size: 0.95em !important;
|
| 585 |
+
border-radius: 8px !important;
|
| 586 |
+
}
|
| 587 |
+
|
| 588 |
+
.hljs-comment, .hljs-quote {
|
| 589 |
+
color: #5f5a60;
|
| 590 |
+
}
|
| 591 |
+
|
| 592 |
+
.hljs-keyword, .hljs-selector-tag, .hljs-literal {
|
| 593 |
+
color: #c25205;
|
| 594 |
+
}
|
| 595 |
+
|
| 596 |
+
.hljs-number, .hljs-variable {
|
| 597 |
+
color: #ae81ff;
|
| 598 |
+
}
|
| 599 |
+
|
| 600 |
+
.hljs-string, .hljs-regexp, .hljs-symbol, .hljs-link {
|
| 601 |
+
color: #67c24f;
|
| 602 |
+
}
|
| 603 |
+
|
| 604 |
+
.hljs-title, .hljs-name, .hljs-type {
|
| 605 |
+
color: #4f94d4;
|
| 606 |
+
}
|
| 607 |
+
|
| 608 |
+
.hljs-attribute {
|
| 609 |
+
color: #e6b673;
|
| 610 |
+
}
|
| 611 |
+
|
| 612 |
+
.hljs-function, .hljs-class .hljs-title {
|
| 613 |
+
color: #4f94d4;
|
| 614 |
+
}
|
| 615 |
+
|
| 616 |
+
.hljs-meta {
|
| 617 |
+
color: #7e7e7e;
|
| 618 |
+
}
|
| 619 |
+
|
| 620 |
/* Spinner Animation */
|
| 621 |
@keyframes spin {
|
| 622 |
0% { transform: rotate(0deg); }
|
|
|
|
| 656 |
yield step
|
| 657 |
|
| 658 |
# Create Gradio interface
|
| 659 |
+
with gr.Blocks(
|
| 660 |
+
css=custom_css,
|
| 661 |
+
title="Research Assistant",
|
| 662 |
+
head="""
|
| 663 |
+
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/styles/github-dark.min.css">
|
| 664 |
+
<script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/highlight.min.js"></script>
|
| 665 |
+
<script>hljs.highlightAll();</script>
|
| 666 |
+
"""
|
| 667 |
+
) as demo:
|
| 668 |
gr.Markdown(f"""
|
| 669 |
<div class="header">
|
| 670 |
<h1 class="title">🧠 AI Research Assistant</h1>
|
|
|
|
| 695 |
with gr.Column(scale=2):
|
| 696 |
with gr.Group(elem_classes=["card", "output-section"]):
|
| 697 |
gr.Markdown("### 📊 Analysis Results")
|
| 698 |
+
|
| 699 |
+
# Progress bar
|
| 700 |
+
progress_container = gr.HTML("""
|
| 701 |
+
<div class="progress-container">
|
| 702 |
+
<div class="progress-bar" id="progress-bar"></div>
|
| 703 |
+
</div>
|
| 704 |
+
""")
|
| 705 |
+
|
| 706 |
output = gr.Markdown(elem_classes=["streaming-content"], visible=True)
|
| 707 |
status_indicator = gr.HTML("""
|
| 708 |
<div class="status-indicator">
|
| 709 |
+
<div class="spinner"></div>
|
| 710 |
<span class="progress-text">Ready for your research query</span>
|
| 711 |
</div>
|
| 712 |
""")
|