ZedLow commited on
Commit
5febdcf
·
verified ·
1 Parent(s): 47f6bf1

Update rag/ui.py

Browse files
Files changed (1) hide show
  1. rag/ui.py +18 -12
rag/ui.py CHANGED
@@ -1,19 +1,29 @@
1
  import gradio as gr
2
 
3
-
4
  def build_demo(retrieve_and_answer):
5
- """
6
- Build the Gradio interface for the Financial RAG demo.
7
-
8
- The UI is intentionally minimal and technical, focusing on
9
- transparency of sources and system behavior rather than aesthetics.
10
- """
11
  with gr.Blocks(title="Financial RAG Demo") as demo:
12
  gr.Markdown("# Financial RAG Demo")
13
  gr.Markdown(
14
  "Architecture: GLiNER (CPU Router) → GTE-7B (Retrieval) → Qwen2-VL (Vision Analysis)"
15
  )
16
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
17
  with gr.Row():
18
  query_input = gr.Textbox(
19
  label="User Question",
@@ -25,11 +35,7 @@ def build_demo(retrieve_and_answer):
25
  submit_btn = gr.Button("Run Analysis", variant="primary")
26
 
27
  with gr.Row():
28
- output_gallery = gr.Gallery(
29
- label="Source Documents",
30
- columns=3,
31
- height=300,
32
- )
33
  output_meta = gr.Markdown(label="System Trace")
34
  output_text = gr.Markdown(label="Answer")
35
 
 
1
  import gradio as gr
2
 
 
3
  def build_demo(retrieve_and_answer):
 
 
 
 
 
 
4
  with gr.Blocks(title="Financial RAG Demo") as demo:
5
  gr.Markdown("# Financial RAG Demo")
6
  gr.Markdown(
7
  "Architecture: GLiNER (CPU Router) → GTE-7B (Retrieval) → Qwen2-VL (Vision Analysis)"
8
  )
9
 
10
+ gr.Markdown(
11
+ """
12
+ ### About this demo
13
+ - Entity-aware routing (Apple / Microsoft)
14
+ - Explicit refusals for out-of-scope or ambiguous queries
15
+ - Tables processed as images (no OCR flattening)
16
+
17
+ ### Try these prompts
18
+ - `What was Apple’s total revenue in 2023?`
19
+ - `What is Microsoft’s operating income?`
20
+ - `Compare Apple and Microsoft revenues` → rejected or limited
21
+ - `What was Google’s revenue in 2023?` → rejected
22
+
23
+ ℹ️ Full details are in the Space README below (scroll) / GitHub repo.
24
+ """
25
+ )
26
+
27
  with gr.Row():
28
  query_input = gr.Textbox(
29
  label="User Question",
 
35
  submit_btn = gr.Button("Run Analysis", variant="primary")
36
 
37
  with gr.Row():
38
+ output_gallery = gr.Gallery(label="Source Documents", columns=3, height=300)
 
 
 
 
39
  output_meta = gr.Markdown(label="System Trace")
40
  output_text = gr.Markdown(label="Answer")
41