Spaces:
Sleeping
Sleeping
Commit
Β·
c3e0a07
1
Parent(s):
911a4b5
Humanize UI: Replace AI jargon and emojis with professional terminology
Browse files- apps/web/app.py +10 -10
apps/web/app.py
CHANGED
|
@@ -137,7 +137,7 @@ def admin_ingest(files, use_sample):
|
|
| 137 |
services.rag.retrieve._shared_retriever = None
|
| 138 |
|
| 139 |
init_services()
|
| 140 |
-
status += "Services reloaded.
|
| 141 |
except Exception as e:
|
| 142 |
print(f"Ingestion Failed: {e}") # Print to server logs
|
| 143 |
import traceback
|
|
@@ -150,7 +150,7 @@ def admin_ingest(files, use_sample):
|
|
| 150 |
init_services()
|
| 151 |
|
| 152 |
with gr.Blocks(title="RAG Knowledge Assistant", theme=gr.themes.Soft()) as demo:
|
| 153 |
-
gr.Markdown("#
|
| 154 |
|
| 155 |
with gr.Row():
|
| 156 |
|
|
@@ -158,7 +158,7 @@ with gr.Blocks(title="RAG Knowledge Assistant", theme=gr.themes.Soft()) as demo:
|
|
| 158 |
with gr.Column(scale=1, variant="panel"):
|
| 159 |
with gr.Group():
|
| 160 |
file_upload = gr.File(
|
| 161 |
-
label="Upload
|
| 162 |
file_count="multiple",
|
| 163 |
file_types=[".pdf", ".txt", ".html"],
|
| 164 |
height=70
|
|
@@ -167,14 +167,14 @@ with gr.Blocks(title="RAG Knowledge Assistant", theme=gr.themes.Soft()) as demo:
|
|
| 167 |
gr.HTML("<div style='text-align: center; color: #666; font-size: 11px; margin: 2px 0;'>β OR β</div>")
|
| 168 |
|
| 169 |
use_sample_chk = gr.Checkbox(
|
| 170 |
-
label="
|
| 171 |
container=False
|
| 172 |
)
|
| 173 |
|
| 174 |
-
ingest_btn = gr.Button("
|
| 175 |
|
| 176 |
# Status Log - Visible by default
|
| 177 |
-
with gr.Accordion("
|
| 178 |
status_box = gr.Textbox(
|
| 179 |
show_label=False,
|
| 180 |
value="System Ready.",
|
|
@@ -194,18 +194,18 @@ with gr.Blocks(title="RAG Knowledge Assistant", theme=gr.themes.Soft()) as demo:
|
|
| 194 |
backend_radio = gr.Radio(
|
| 195 |
choices=["openai", "gemini", "local"],
|
| 196 |
value="openai",
|
| 197 |
-
label="
|
| 198 |
container=False
|
| 199 |
)
|
| 200 |
-
gr.HTML("<div style='font-size: 9px; color: #888; margin-top: 2px;'>*Local
|
| 201 |
|
| 202 |
# Right Column: Main App (Chat)
|
| 203 |
with gr.Column(scale=4):
|
| 204 |
chatbot = gr.ChatInterface(
|
| 205 |
fn=chat_fn,
|
| 206 |
additional_inputs=[backend_radio],
|
| 207 |
-
title="
|
| 208 |
-
description="
|
| 209 |
examples=[
|
| 210 |
["Who is the greatest quarterback?", "openai"],
|
| 211 |
["Summary of Lionel Messi", "local"]
|
|
|
|
| 137 |
services.rag.retrieve._shared_retriever = None
|
| 138 |
|
| 139 |
init_services()
|
| 140 |
+
status += "Services reloaded. Index updated successfully."
|
| 141 |
except Exception as e:
|
| 142 |
print(f"Ingestion Failed: {e}") # Print to server logs
|
| 143 |
import traceback
|
|
|
|
| 150 |
init_services()
|
| 151 |
|
| 152 |
with gr.Blocks(title="RAG Knowledge Assistant", theme=gr.themes.Soft()) as demo:
|
| 153 |
+
gr.Markdown("# RAG Knowledge Assistant")
|
| 154 |
|
| 155 |
with gr.Row():
|
| 156 |
|
|
|
|
| 158 |
with gr.Column(scale=1, variant="panel"):
|
| 159 |
with gr.Group():
|
| 160 |
file_upload = gr.File(
|
| 161 |
+
label="Document Upload",
|
| 162 |
file_count="multiple",
|
| 163 |
file_types=[".pdf", ".txt", ".html"],
|
| 164 |
height=70
|
|
|
|
| 167 |
gr.HTML("<div style='text-align: center; color: #666; font-size: 11px; margin: 2px 0;'>β OR β</div>")
|
| 168 |
|
| 169 |
use_sample_chk = gr.Checkbox(
|
| 170 |
+
label="Use Sample Dataset",
|
| 171 |
container=False
|
| 172 |
)
|
| 173 |
|
| 174 |
+
ingest_btn = gr.Button("Process Documents", variant="primary", size="sm")
|
| 175 |
|
| 176 |
# Status Log - Visible by default
|
| 177 |
+
with gr.Accordion("System Logs", open=True):
|
| 178 |
status_box = gr.Textbox(
|
| 179 |
show_label=False,
|
| 180 |
value="System Ready.",
|
|
|
|
| 194 |
backend_radio = gr.Radio(
|
| 195 |
choices=["openai", "gemini", "local"],
|
| 196 |
value="openai",
|
| 197 |
+
label="LLM Backend",
|
| 198 |
container=False
|
| 199 |
)
|
| 200 |
+
gr.HTML("<div style='font-size: 9px; color: #888; margin-top: 2px;'>*Local execution using ZeroGPU</div>")
|
| 201 |
|
| 202 |
# Right Column: Main App (Chat)
|
| 203 |
with gr.Column(scale=4):
|
| 204 |
chatbot = gr.ChatInterface(
|
| 205 |
fn=chat_fn,
|
| 206 |
additional_inputs=[backend_radio],
|
| 207 |
+
title="Chat Interface",
|
| 208 |
+
description="Ask questions about your uploaded documents.",
|
| 209 |
examples=[
|
| 210 |
["Who is the greatest quarterback?", "openai"],
|
| 211 |
["Summary of Lionel Messi", "local"]
|