ZedLow commited on
Commit
ab45f59
·
verified ·
1 Parent(s): 319c1e2

Update rag/ui.py

Browse files
Files changed (1) hide show
  1. rag/ui.py +25 -9
rag/ui.py CHANGED
@@ -1,21 +1,37 @@
1
  import gradio as gr
2
 
 
3
  def build_demo(retrieve_and_answer):
4
- with gr.Blocks(title="RAG Finance Pro") as demo:
5
- gr.Markdown("# 🧠 Agentic RAG Finance")
6
- gr.Markdown("Architecture : **GLiNER (CPU Router)** → **GTE-7B (Retrieval)** → **Qwen2-VL (Analysis)**")
 
 
 
 
 
 
 
 
7
 
8
  with gr.Row():
9
  query_input = gr.Textbox(
10
- label="Question",
11
- placeholder="Ex: Compare Apple and Microsoft revenue, or ask about Tesla.",
 
 
 
12
  )
13
- submit_btn = gr.Button("Analyser", variant="primary")
14
 
15
  with gr.Row():
16
- output_gallery = gr.Gallery(label="Docs", columns=3, height=300)
17
- output_meta = gr.Markdown(label="Raisonnement IA")
18
- output_text = gr.Markdown(label="Réponse")
 
 
 
 
19
 
20
  submit_btn.click(
21
  retrieve_and_answer,
 
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",
20
+ placeholder=(
21
+ "Example: Compare Apple and Microsoft revenue, "
22
+ "or ask about a specific company metric."
23
+ ),
24
  )
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
 
36
  submit_btn.click(
37
  retrieve_and_answer,