Wall06 commited on
Commit
9653244
Β·
verified Β·
1 Parent(s): afd7f8c

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +11 -8
app.py CHANGED
@@ -3,7 +3,7 @@ from rag_engine import RAGEngine
3
 
4
  engine = RAGEngine()
5
 
6
- # ── Functions ─────────────────────────────
7
 
8
  def load_pdf(file):
9
  if not file:
@@ -32,9 +32,9 @@ def reset():
32
  engine.reset()
33
  return [], "", "Reset done"
34
 
35
- # ── UI ───────────────────────────────────
36
 
37
- with gr.Blocks(title="RAG Bot") as demo:
38
  gr.Markdown("# πŸ€– RAG Chatbot")
39
 
40
  with gr.Row():
@@ -51,11 +51,14 @@ with gr.Blocks(title="RAG Bot") as demo:
51
  status = gr.Textbox(value="Load data", interactive=False)
52
 
53
  with gr.Column():
54
- chatbot = gr.Chatbot() # βœ… FIXED (no bubble_full_width)
55
 
56
- msg = gr.Textbox(placeholder="Ask something...", interactive=False)
57
- send = gr.Button("Send")
 
 
58
 
 
59
  reset_btn = gr.Button("Reset")
60
 
61
  btn_pdf.click(load_pdf, pdf, [status, msg])
@@ -67,5 +70,5 @@ with gr.Blocks(title="RAG Bot") as demo:
67
 
68
  reset_btn.click(reset, outputs=[chatbot, msg, status])
69
 
70
- if __name__ == "__main__":
71
- demo.launch()
 
3
 
4
  engine = RAGEngine()
5
 
6
+ # ── Functions ─────────────────────────
7
 
8
  def load_pdf(file):
9
  if not file:
 
32
  engine.reset()
33
  return [], "", "Reset done"
34
 
35
+ # ── UI ───────────────────────────────
36
 
37
+ with gr.Blocks(title="RAG Chatbot") as demo:
38
  gr.Markdown("# πŸ€– RAG Chatbot")
39
 
40
  with gr.Row():
 
51
  status = gr.Textbox(value="Load data", interactive=False)
52
 
53
  with gr.Column():
54
+ chatbot = gr.Chatbot()
55
 
56
+ msg = gr.Textbox(
57
+ placeholder="Ask something...",
58
+ interactive=False
59
+ )
60
 
61
+ send = gr.Button("Send")
62
  reset_btn = gr.Button("Reset")
63
 
64
  btn_pdf.click(load_pdf, pdf, [status, msg])
 
70
 
71
  reset_btn.click(reset, outputs=[chatbot, msg, status])
72
 
73
+ # βœ… IMPORTANT (Gradio 6 style)
74
+ demo.launch()