Spaces:
Running
Running
Upload 67 files
Browse files- .gitattributes +1 -0
- app.py +136 -59
- img/logo.png +3 -0
.gitattributes
CHANGED
|
@@ -33,3 +33,4 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
|
|
| 33 |
*.zip filter=lfs diff=lfs merge=lfs -text
|
| 34 |
*.zst filter=lfs diff=lfs merge=lfs -text
|
| 35 |
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
|
|
|
|
|
| 33 |
*.zip filter=lfs diff=lfs merge=lfs -text
|
| 34 |
*.zst filter=lfs diff=lfs merge=lfs -text
|
| 35 |
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
| 36 |
+
img/logo.png filter=lfs diff=lfs merge=lfs -text
|
app.py
CHANGED
|
@@ -24,6 +24,7 @@ from pi_wrapper import run_pi_stream
|
|
| 24 |
APP_DIR = Path(__file__).resolve().parent
|
| 25 |
DEFAULT_CORPUS_DIR = APP_DIR / "default_corpus"
|
| 26 |
DEFAULT_CORPUS_LABEL = "Default (bright_corpus)"
|
|
|
|
| 27 |
|
| 28 |
|
| 29 |
# โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
|
|
@@ -145,6 +146,18 @@ CUSTOM_CSS = """
|
|
| 145 |
}
|
| 146 |
html.dark .hero-wrap { border-bottom: 1px solid #475569; }
|
| 147 |
html:not(.dark) .hero-wrap { border-bottom: 1px solid #E5EBF0; }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 148 |
.hero-title {
|
| 149 |
font-size: 38px !important;
|
| 150 |
font-weight: 800 !important;
|
|
@@ -154,7 +167,7 @@ html:not(.dark) .hero-wrap { border-bottom: 1px solid #E5EBF0; }
|
|
| 154 |
-webkit-background-clip: text !important;
|
| 155 |
-webkit-text-fill-color: transparent !important;
|
| 156 |
background-clip: text !important;
|
| 157 |
-
margin: 0
|
| 158 |
padding-bottom: 4px !important;
|
| 159 |
display: block;
|
| 160 |
}
|
|
@@ -164,7 +177,7 @@ html:not(.dark) .hero-wrap { border-bottom: 1px solid #E5EBF0; }
|
|
| 164 |
letter-spacing: 0.1em !important;
|
| 165 |
text-transform: uppercase !important;
|
| 166 |
color: #64748B !important;
|
| 167 |
-
margin:
|
| 168 |
display: block;
|
| 169 |
}
|
| 170 |
.hero-links {
|
|
@@ -289,6 +302,24 @@ div[class*="file-upload"]:hover {
|
|
| 289 |
[data-testid="upload"] svg { stroke: #6B6B8A !important; }
|
| 290 |
|
| 291 |
/* โโ Terminal composer โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ */
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 292 |
#terminal-question-input textarea {
|
| 293 |
min-height: 90px !important;
|
| 294 |
max-height: 180px !important;
|
|
@@ -441,14 +472,21 @@ html:not(.dark) .log-block { background: #FFFFFF !important; border: 1px solid #
|
|
| 441 |
}
|
| 442 |
.ex-grid {
|
| 443 |
display: grid;
|
| 444 |
-
grid-template-columns: repeat(2, 1fr);
|
| 445 |
gap: 10px;
|
| 446 |
margin-top: 10px;
|
|
|
|
|
|
|
|
|
|
| 447 |
}
|
| 448 |
@media (max-width: 680px) { .ex-grid { grid-template-columns: 1fr; } }
|
| 449 |
.ex-card {
|
| 450 |
border-radius: 12px;
|
| 451 |
padding: 14px 16px;
|
|
|
|
|
|
|
|
|
|
|
|
|
| 452 |
cursor: pointer;
|
| 453 |
transition: border-color .18s, background .18s, transform .12s, box-shadow .18s;
|
| 454 |
}
|
|
@@ -499,6 +537,17 @@ html:not(.dark) .ex-a { color:#7C6FA8; border-top:1px solid #EDE9FE; }
|
|
| 499 |
.ex-a::before { content: "A ยท "; font-weight: 700; }
|
| 500 |
html.dark .ex-a::before { color:#4E4E72; }
|
| 501 |
html:not(.dark) .ex-a::before { color:#A89CC8; }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 502 |
|
| 503 |
/* โโ Scrollbar โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ */
|
| 504 |
::-webkit-scrollbar { width: 5px; height: 5px; }
|
|
@@ -652,11 +701,23 @@ window.fillQuestion = function(text) {
|
|
| 652 |
el.scrollIntoView({ behavior: 'smooth', block: 'center' });
|
| 653 |
};
|
| 654 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 655 |
/* Auto-scroll terminal whenever new log lines arrive */
|
| 656 |
new MutationObserver(function() {
|
| 657 |
var t = document.querySelector('.terminal-wrapper');
|
| 658 |
if (t) t.scrollTop = t.scrollHeight;
|
|
|
|
| 659 |
}).observe(document.body, { childList: true, subtree: true });
|
|
|
|
|
|
|
| 660 |
"""
|
| 661 |
|
| 662 |
|
|
@@ -668,43 +729,50 @@ EXAMPLES_DATA: List[Dict[str, str]] = [
|
|
| 668 |
"dataset": "Animal Science",
|
| 669 |
"corpus": "biology",
|
| 670 |
"question": "According to the documents about animal handedness, what types of animals are mentioned as being kept as pets? Cite the file path where you found this.",
|
| 671 |
-
"answer": "Parrots, dogs, and
|
|
|
|
| 672 |
},
|
| 673 |
{
|
| 674 |
"dataset": "Biology",
|
| 675 |
"corpus": "biology",
|
| 676 |
"question": "What bacterium is mentioned as being used as a pesticide in the biology documents? Provide the specific name.",
|
| 677 |
-
"answer": "Bacillus thuringiensis (Bt) โ a
|
|
|
|
| 678 |
},
|
| 679 |
{
|
| 680 |
"dataset": "Earth Science",
|
| 681 |
"corpus": "earth_science",
|
| 682 |
-
"question": "
|
| 683 |
-
"answer": "
|
|
|
|
| 684 |
},
|
| 685 |
{
|
| 686 |
"dataset": "Earth Science",
|
| 687 |
"corpus": "earth_science",
|
| 688 |
-
"question": "According to the
|
| 689 |
-
"answer": "
|
|
|
|
| 690 |
},
|
| 691 |
{
|
| 692 |
"dataset": "Economics",
|
| 693 |
"corpus": "economics",
|
| 694 |
-
"question": "
|
| 695 |
-
"answer": "
|
|
|
|
| 696 |
},
|
| 697 |
{
|
| 698 |
"dataset": "Robotics",
|
| 699 |
"corpus": "robotics",
|
| 700 |
-
"question": "In the robotics documents,
|
| 701 |
-
"answer": "
|
|
|
|
| 702 |
},
|
| 703 |
{
|
| 704 |
-
"dataset": "
|
| 705 |
"corpus": "robotics",
|
| 706 |
-
"question": "
|
| 707 |
-
"answer": "
|
|
|
|
| 708 |
},
|
| 709 |
]
|
| 710 |
|
|
@@ -718,11 +786,14 @@ def _build_examples_html() -> str:
|
|
| 718 |
)
|
| 719 |
a_disp = _html.escape(ex.get("answer", ""))
|
| 720 |
d_disp = _html.escape(ex["dataset"])
|
|
|
|
|
|
|
| 721 |
cards.append(
|
| 722 |
f'<div class="ex-card" data-q="{q_attr}" onclick="fillQuestion(this.dataset.q)">'
|
| 723 |
f'<span class="ex-ds">{d_disp}</span>'
|
| 724 |
f'<p class="ex-q">{q_disp}</p>'
|
| 725 |
f'<p class="ex-a">{a_disp}</p>'
|
|
|
|
| 726 |
f"</div>"
|
| 727 |
)
|
| 728 |
return f'<div class="ex-grid">{"".join(cards)}</div>'
|
|
@@ -1090,12 +1161,16 @@ def run_search(
|
|
| 1090 |
# Gradio UI
|
| 1091 |
# โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
|
| 1092 |
def build_ui() -> gr.Blocks:
|
|
|
|
| 1093 |
with gr.Blocks(title="DCI-Agent Search") as demo:
|
| 1094 |
|
| 1095 |
# โโ Hero โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
|
| 1096 |
-
gr.HTML("""
|
| 1097 |
<div class="hero-wrap">
|
| 1098 |
-
<
|
|
|
|
|
|
|
|
|
|
| 1099 |
<span class="hero-subtitle">
|
| 1100 |
High-resolution direct corpus interaction ยท read, search & reason
|
| 1101 |
</span>
|
|
@@ -1187,47 +1262,48 @@ def build_ui() -> gr.Blocks:
|
|
| 1187 |
# โโ Right main panel โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
|
| 1188 |
with gr.Column(scale=3):
|
| 1189 |
|
| 1190 |
-
with gr.Column()
|
| 1191 |
-
gr.
|
| 1192 |
-
|
| 1193 |
-
|
| 1194 |
-
|
| 1195 |
-
|
| 1196 |
-
|
| 1197 |
-
|
| 1198 |
-
)
|
| 1199 |
-
|
| 1200 |
-
|
| 1201 |
-
|
| 1202 |
-
|
| 1203 |
-
|
| 1204 |
-
|
| 1205 |
-
|
| 1206 |
-
|
| 1207 |
-
|
| 1208 |
-
|
| 1209 |
-
|
| 1210 |
-
|
| 1211 |
-
|
| 1212 |
-
|
| 1213 |
-
|
| 1214 |
-
|
| 1215 |
-
|
| 1216 |
-
|
| 1217 |
-
|
| 1218 |
-
|
| 1219 |
-
|
| 1220 |
-
|
| 1221 |
-
|
| 1222 |
-
|
| 1223 |
-
|
| 1224 |
-
|
| 1225 |
-
|
| 1226 |
-
|
| 1227 |
-
|
| 1228 |
-
|
| 1229 |
-
|
| 1230 |
-
|
|
|
|
| 1231 |
|
| 1232 |
# โโ Wiring โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
|
| 1233 |
def _toggle_upload(source: str):
|
|
@@ -1281,4 +1357,5 @@ if __name__ == "__main__":
|
|
| 1281 |
theme=PP_THEME,
|
| 1282 |
css=CUSTOM_CSS,
|
| 1283 |
js=GLOBAL_JS,
|
|
|
|
| 1284 |
)
|
|
|
|
| 24 |
APP_DIR = Path(__file__).resolve().parent
|
| 25 |
DEFAULT_CORPUS_DIR = APP_DIR / "default_corpus"
|
| 26 |
DEFAULT_CORPUS_LABEL = "Default (bright_corpus)"
|
| 27 |
+
HERO_LOGO_PATH = APP_DIR / "img" / "logo.png"
|
| 28 |
|
| 29 |
|
| 30 |
# โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
|
|
|
|
| 146 |
}
|
| 147 |
html.dark .hero-wrap { border-bottom: 1px solid #475569; }
|
| 148 |
html:not(.dark) .hero-wrap { border-bottom: 1px solid #E5EBF0; }
|
| 149 |
+
.hero-title-row {
|
| 150 |
+
display: flex;
|
| 151 |
+
align-items: center;
|
| 152 |
+
gap: 14px;
|
| 153 |
+
margin: 0 0 18px !important;
|
| 154 |
+
}
|
| 155 |
+
.hero-logo {
|
| 156 |
+
width: 79px;
|
| 157 |
+
height: 79px;
|
| 158 |
+
object-fit: contain;
|
| 159 |
+
flex: 0 0 79px;
|
| 160 |
+
}
|
| 161 |
.hero-title {
|
| 162 |
font-size: 38px !important;
|
| 163 |
font-weight: 800 !important;
|
|
|
|
| 167 |
-webkit-background-clip: text !important;
|
| 168 |
-webkit-text-fill-color: transparent !important;
|
| 169 |
background-clip: text !important;
|
| 170 |
+
margin: 0 !important;
|
| 171 |
padding-bottom: 4px !important;
|
| 172 |
display: block;
|
| 173 |
}
|
|
|
|
| 177 |
letter-spacing: 0.1em !important;
|
| 178 |
text-transform: uppercase !important;
|
| 179 |
color: #64748B !important;
|
| 180 |
+
margin: 2px 0 14px !important;
|
| 181 |
display: block;
|
| 182 |
}
|
| 183 |
.hero-links {
|
|
|
|
| 302 |
[data-testid="upload"] svg { stroke: #6B6B8A !important; }
|
| 303 |
|
| 304 |
/* โโ Terminal composer โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ */
|
| 305 |
+
#terminal-shell {
|
| 306 |
+
display: flex !important;
|
| 307 |
+
flex-direction: column !important;
|
| 308 |
+
gap: 8px !important;
|
| 309 |
+
}
|
| 310 |
+
#terminal-input-wrap { order: 1; }
|
| 311 |
+
#terminal-actions-wrap { order: 2; }
|
| 312 |
+
#terminal-examples-wrap { order: 3; }
|
| 313 |
+
#terminal-log-wrap { order: 4; }
|
| 314 |
+
#terminal-examples-wrap {
|
| 315 |
+
width: 100% !important;
|
| 316 |
+
min-width: 0 !important;
|
| 317 |
+
overflow: hidden !important;
|
| 318 |
+
}
|
| 319 |
+
#terminal-shell.has-run #terminal-log-wrap { order: 1; }
|
| 320 |
+
#terminal-shell.has-run #terminal-input-wrap { order: 2; }
|
| 321 |
+
#terminal-shell.has-run #terminal-actions-wrap { order: 3; }
|
| 322 |
+
#terminal-shell.has-run #terminal-examples-wrap { order: 4; }
|
| 323 |
#terminal-question-input textarea {
|
| 324 |
min-height: 90px !important;
|
| 325 |
max-height: 180px !important;
|
|
|
|
| 472 |
}
|
| 473 |
.ex-grid {
|
| 474 |
display: grid;
|
| 475 |
+
grid-template-columns: repeat(2, minmax(0, 1fr));
|
| 476 |
gap: 10px;
|
| 477 |
margin-top: 10px;
|
| 478 |
+
width: 100%;
|
| 479 |
+
box-sizing: border-box;
|
| 480 |
+
overflow: hidden;
|
| 481 |
}
|
| 482 |
@media (max-width: 680px) { .ex-grid { grid-template-columns: 1fr; } }
|
| 483 |
.ex-card {
|
| 484 |
border-radius: 12px;
|
| 485 |
padding: 14px 16px;
|
| 486 |
+
width: 100%;
|
| 487 |
+
min-width: 0;
|
| 488 |
+
box-sizing: border-box;
|
| 489 |
+
overflow: hidden;
|
| 490 |
cursor: pointer;
|
| 491 |
transition: border-color .18s, background .18s, transform .12s, box-shadow .18s;
|
| 492 |
}
|
|
|
|
| 537 |
.ex-a::before { content: "A ยท "; font-weight: 700; }
|
| 538 |
html.dark .ex-a::before { color:#4E4E72; }
|
| 539 |
html:not(.dark) .ex-a::before { color:#A89CC8; }
|
| 540 |
+
.ex-g {
|
| 541 |
+
font-size: 10.5px;
|
| 542 |
+
line-height: 1.45;
|
| 543 |
+
margin: 8px 0 0;
|
| 544 |
+
word-break: break-word;
|
| 545 |
+
overflow-wrap: anywhere;
|
| 546 |
+
white-space: normal;
|
| 547 |
+
font-family: 'JetBrains Mono', monospace;
|
| 548 |
+
}
|
| 549 |
+
html.dark .ex-g { color:#8B8BA8; }
|
| 550 |
+
html:not(.dark) .ex-g { color:#64748B; }
|
| 551 |
|
| 552 |
/* โโ Scrollbar โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ */
|
| 553 |
::-webkit-scrollbar { width: 5px; height: 5px; }
|
|
|
|
| 701 |
el.scrollIntoView({ behavior: 'smooth', block: 'center' });
|
| 702 |
};
|
| 703 |
|
| 704 |
+
window.syncTerminalShellState = function() {
|
| 705 |
+
var shell = document.querySelector('#terminal-shell');
|
| 706 |
+
var terminal = document.querySelector('.terminal-wrapper');
|
| 707 |
+
if (!shell || !terminal) return;
|
| 708 |
+
var text = (terminal.textContent || '').trim();
|
| 709 |
+
var isIdle = !text || text.indexOf('Waiting for run') !== -1;
|
| 710 |
+
shell.classList.toggle('has-run', !isIdle);
|
| 711 |
+
};
|
| 712 |
+
|
| 713 |
/* Auto-scroll terminal whenever new log lines arrive */
|
| 714 |
new MutationObserver(function() {
|
| 715 |
var t = document.querySelector('.terminal-wrapper');
|
| 716 |
if (t) t.scrollTop = t.scrollHeight;
|
| 717 |
+
window.syncTerminalShellState();
|
| 718 |
}).observe(document.body, { childList: true, subtree: true });
|
| 719 |
+
|
| 720 |
+
window.syncTerminalShellState();
|
| 721 |
"""
|
| 722 |
|
| 723 |
|
|
|
|
| 729 |
"dataset": "Animal Science",
|
| 730 |
"corpus": "biology",
|
| 731 |
"question": "According to the documents about animal handedness, what types of animals are mentioned as being kept as pets? Cite the file path where you found this.",
|
| 732 |
+
"answer": "Parrots, dogs, cats, and rabbits are mentioned as commonly kept pets.",
|
| 733 |
+
"gold_doc": "biology/animals_handedness_Animal_8_3.txt.txt",
|
| 734 |
},
|
| 735 |
{
|
| 736 |
"dataset": "Biology",
|
| 737 |
"corpus": "biology",
|
| 738 |
"question": "What bacterium is mentioned as being used as a pesticide in the biology documents? Provide the specific name.",
|
| 739 |
+
"answer": "Bacillus thuringiensis (Bt) โ a Gram-positive, soil-dwelling bacterium.",
|
| 740 |
+
"gold_doc": "biology/bacterium_infect_another_Bacteria_13_2.txt.txt",
|
| 741 |
},
|
| 742 |
{
|
| 743 |
"dataset": "Earth Science",
|
| 744 |
"corpus": "earth_science",
|
| 745 |
+
"question": "According to the earth science documents, what annual rainfall range is given for a tropical savanna?",
|
| 746 |
+
"answer": "Between 750 millimetres and 1,270 millimetres per year.",
|
| 747 |
+
"gold_doc": "earth_science/arid_area_Earth_rainfall_climatology4_10.txt.txt",
|
| 748 |
},
|
| 749 |
{
|
| 750 |
"dataset": "Earth Science",
|
| 751 |
"corpus": "earth_science",
|
| 752 |
+
"question": "According to the drifting guide in the earth science corpus, which drivetrain is particularly good for drifting?",
|
| 753 |
+
"answer": "Rear-wheel drive.",
|
| 754 |
+
"gold_doc": "earth_science/continental_drift_what_is_drifting_guide1_7.txt.txt",
|
| 755 |
},
|
| 756 |
{
|
| 757 |
"dataset": "Economics",
|
| 758 |
"corpus": "economics",
|
| 759 |
+
"question": "According to the economics documents, what major event is described as a turning point after which fertility mostly continued to fall?",
|
| 760 |
+
"answer": "The Great Recession.",
|
| 761 |
+
"gold_doc": "economics/uspopulationgrowth_thelongtermdeclineinfertilityandwhatitmeansforstatebudgets_76.txt.txt",
|
| 762 |
},
|
| 763 |
{
|
| 764 |
"dataset": "Robotics",
|
| 765 |
"corpus": "robotics",
|
| 766 |
+
"question": "In the robotics documents, which message type is converted to Ackermann inputs?",
|
| 767 |
+
"answer": "geometry_msgs/Twist.",
|
| 768 |
+
"gold_doc": "robotics/ackermann_interfacecontrolchec_53.txt.txt",
|
| 769 |
},
|
| 770 |
{
|
| 771 |
+
"dataset": "Robotics",
|
| 772 |
"corpus": "robotics",
|
| 773 |
+
"question": "According to the robotics documents, which launch file combines tf-broadcaster and pcl2-spammer data into an octomap?",
|
| 774 |
+
"answer": "octomap_mapping.launch.",
|
| 775 |
+
"gold_doc": "robotics/octomap_publish_4NI0GL435o_171.txt.txt",
|
| 776 |
},
|
| 777 |
]
|
| 778 |
|
|
|
|
| 786 |
)
|
| 787 |
a_disp = _html.escape(ex.get("answer", ""))
|
| 788 |
d_disp = _html.escape(ex["dataset"])
|
| 789 |
+
gold_doc = ex.get("gold_doc", "").replace(".txt.txt", ".txt")
|
| 790 |
+
g_disp = _html.escape(gold_doc)
|
| 791 |
cards.append(
|
| 792 |
f'<div class="ex-card" data-q="{q_attr}" onclick="fillQuestion(this.dataset.q)">'
|
| 793 |
f'<span class="ex-ds">{d_disp}</span>'
|
| 794 |
f'<p class="ex-q">{q_disp}</p>'
|
| 795 |
f'<p class="ex-a">{a_disp}</p>'
|
| 796 |
+
f'<p class="ex-g">Gold doc: {g_disp}</p>'
|
| 797 |
f"</div>"
|
| 798 |
)
|
| 799 |
return f'<div class="ex-grid">{"".join(cards)}</div>'
|
|
|
|
| 1161 |
# Gradio UI
|
| 1162 |
# โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
|
| 1163 |
def build_ui() -> gr.Blocks:
|
| 1164 |
+
hero_logo_src = f"/gradio_api/file={HERO_LOGO_PATH}"
|
| 1165 |
with gr.Blocks(title="DCI-Agent Search") as demo:
|
| 1166 |
|
| 1167 |
# โโ Hero โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
|
| 1168 |
+
gr.HTML(f"""
|
| 1169 |
<div class="hero-wrap">
|
| 1170 |
+
<div class="hero-title-row">
|
| 1171 |
+
<img class="hero-logo" src="{hero_logo_src}" alt="DCI-Agent logo" />
|
| 1172 |
+
<span class="hero-title">DCI-Agent Search</span>
|
| 1173 |
+
</div>
|
| 1174 |
<span class="hero-subtitle">
|
| 1175 |
High-resolution direct corpus interaction ยท read, search & reason
|
| 1176 |
</span>
|
|
|
|
| 1262 |
# โโ Right main panel โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
|
| 1263 |
with gr.Column(scale=3):
|
| 1264 |
|
| 1265 |
+
with gr.Column(elem_id="terminal-shell"):
|
| 1266 |
+
with gr.Column(elem_id="terminal-input-wrap"):
|
| 1267 |
+
terminal_question = gr.Textbox(
|
| 1268 |
+
label="",
|
| 1269 |
+
placeholder="Type your question here. The full interaction will stay in the execution log.",
|
| 1270 |
+
lines=3,
|
| 1271 |
+
elem_id="terminal-question-input",
|
| 1272 |
+
)
|
| 1273 |
+
with gr.Row(elem_id="terminal-actions-wrap"):
|
| 1274 |
+
run_btn = gr.Button(
|
| 1275 |
+
"โถ Run Search",
|
| 1276 |
+
variant="primary",
|
| 1277 |
+
elem_classes=["btn-run"],
|
| 1278 |
+
scale=3,
|
| 1279 |
+
)
|
| 1280 |
+
stop_btn = gr.Button(
|
| 1281 |
+
"โ Stop",
|
| 1282 |
+
variant="secondary",
|
| 1283 |
+
elem_classes=["btn-stop"],
|
| 1284 |
+
scale=1,
|
| 1285 |
+
)
|
| 1286 |
+
clear_btn = gr.Button(
|
| 1287 |
+
"Clear",
|
| 1288 |
+
variant="secondary",
|
| 1289 |
+
elem_classes=["btn-clear"],
|
| 1290 |
+
scale=1,
|
| 1291 |
+
)
|
| 1292 |
+
with gr.Column(elem_id="terminal-examples-wrap"):
|
| 1293 |
+
gr.HTML(f"""
|
| 1294 |
+
<div style="margin-top:20px">
|
| 1295 |
+
<span class="sec-label">
|
| 1296 |
+
Example Questions
|
| 1297 |
+
<span style="font-weight:400;text-transform:none;letter-spacing:0;color:#4E4E72;font-size:10.5px">
|
| 1298 |
+
โ click to fill
|
| 1299 |
+
</span>
|
| 1300 |
+
</span>
|
| 1301 |
+
{_build_examples_html()}
|
| 1302 |
+
</div>
|
| 1303 |
+
""")
|
| 1304 |
+
with gr.Column(elem_id="terminal-log-wrap"):
|
| 1305 |
+
gr.HTML('<span class="sec-label">Execution Log</span>')
|
| 1306 |
+
terminal = gr.HTML(value=_TERM_IDLE)
|
| 1307 |
|
| 1308 |
# โโ Wiring โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
|
| 1309 |
def _toggle_upload(source: str):
|
|
|
|
| 1357 |
theme=PP_THEME,
|
| 1358 |
css=CUSTOM_CSS,
|
| 1359 |
js=GLOBAL_JS,
|
| 1360 |
+
allowed_paths=[str(APP_DIR / "img")],
|
| 1361 |
)
|
img/logo.png
ADDED
|
Git LFS Details
|