Spaces:
Sleeping
Sleeping
Commit
Β·
b8d80bf
1
Parent(s):
117a0aa
Refactor UI: Ultra-compact sidebar with minimal whitespace
Browse files- apps/web/app.py +7 -11
apps/web/app.py
CHANGED
|
@@ -148,25 +148,22 @@ with gr.Blocks(title="RAG Knowledge Assistant", theme=gr.themes.Soft()) as demo:
|
|
| 148 |
|
| 149 |
# Left Column: Sidebar (Controls & Guide)
|
| 150 |
with gr.Column(scale=1, variant="panel"):
|
| 151 |
-
gr.Markdown("### ποΈ Control Panel")
|
| 152 |
-
|
| 153 |
with gr.Group():
|
| 154 |
-
gr.Markdown("#### 1. Knowledge Base")
|
| 155 |
file_upload = gr.File(
|
| 156 |
-
label="Upload
|
| 157 |
file_count="multiple",
|
| 158 |
file_types=[".pdf", ".txt", ".html"],
|
| 159 |
-
height=
|
| 160 |
)
|
| 161 |
|
| 162 |
-
gr.HTML("<div style='text-align: center; color: #666; font-size:
|
| 163 |
|
| 164 |
use_sample_chk = gr.Checkbox(
|
| 165 |
-
label="
|
| 166 |
container=False
|
| 167 |
)
|
| 168 |
|
| 169 |
-
ingest_btn = gr.Button("π Update Brain", variant="primary")
|
| 170 |
|
| 171 |
# Status Log - Hidden by default to save space
|
| 172 |
with gr.Accordion("π View Logs", open=False):
|
|
@@ -185,15 +182,14 @@ with gr.Blocks(title="RAG Knowledge Assistant", theme=gr.themes.Soft()) as demo:
|
|
| 185 |
outputs=[status_box]
|
| 186 |
)
|
| 187 |
|
| 188 |
-
gr.Markdown("#### 2. Model Settings")
|
| 189 |
with gr.Group():
|
| 190 |
backend_radio = gr.Radio(
|
| 191 |
choices=["openai", "gemini", "local"],
|
| 192 |
value="openai",
|
| 193 |
-
label="
|
| 194 |
container=False
|
| 195 |
)
|
| 196 |
-
gr.HTML("<div style='font-size:
|
| 197 |
|
| 198 |
# Right Column: Main App (Chat)
|
| 199 |
with gr.Column(scale=4):
|
|
|
|
| 148 |
|
| 149 |
# Left Column: Sidebar (Controls & Guide)
|
| 150 |
with gr.Column(scale=1, variant="panel"):
|
|
|
|
|
|
|
| 151 |
with gr.Group():
|
|
|
|
| 152 |
file_upload = gr.File(
|
| 153 |
+
label="Upload Docs",
|
| 154 |
file_count="multiple",
|
| 155 |
file_types=[".pdf", ".txt", ".html"],
|
| 156 |
+
height=70
|
| 157 |
)
|
| 158 |
|
| 159 |
+
gr.HTML("<div style='text-align: center; color: #666; font-size: 11px; margin: 2px 0;'>β OR β</div>")
|
| 160 |
|
| 161 |
use_sample_chk = gr.Checkbox(
|
| 162 |
+
label="Sports Legends (Demo)",
|
| 163 |
container=False
|
| 164 |
)
|
| 165 |
|
| 166 |
+
ingest_btn = gr.Button("π Update Brain", variant="primary", size="sm")
|
| 167 |
|
| 168 |
# Status Log - Hidden by default to save space
|
| 169 |
with gr.Accordion("π View Logs", open=False):
|
|
|
|
| 182 |
outputs=[status_box]
|
| 183 |
)
|
| 184 |
|
|
|
|
| 185 |
with gr.Group():
|
| 186 |
backend_radio = gr.Radio(
|
| 187 |
choices=["openai", "gemini", "local"],
|
| 188 |
value="openai",
|
| 189 |
+
label="Brain / Model",
|
| 190 |
container=False
|
| 191 |
)
|
| 192 |
+
gr.HTML("<div style='font-size: 9px; color: #888; margin-top: 2px;'>*Local = ZeroGPU</div>")
|
| 193 |
|
| 194 |
# Right Column: Main App (Chat)
|
| 195 |
with gr.Column(scale=4):
|