NaimaAqeel commited on
Commit
988505b
·
verified ·
1 Parent(s): 51ccebc

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +15 -5
app.py CHANGED
@@ -45,12 +45,22 @@ def ask_question(file, question, history):
45
  history.append((question, answer))
46
  return "", history
47
 
48
- with gr.Blocks() as demo:
49
- gr.Markdown("## Document QA with Smart Retrieval")
50
- file_input = gr.File(label="Upload PDF or Word", file_types=[".pdf", ".docx"])
51
- chatbot = gr.Chatbot()
52
- question = gr.Textbox(label="Ask your question")
 
 
 
 
 
 
 
 
 
53
  state = gr.State([])
 
54
  question.submit(ask_question, [file_input, question, state], [question, chatbot])
55
 
56
  demo.launch()
 
45
  history.append((question, answer))
46
  return "", history
47
 
48
+ with gr.Blocks(theme=gr.themes.Soft()) as demo:
49
+ gr.Markdown("## 📄 Document QA with Smart Retrieval")
50
+
51
+ with gr.Group():
52
+ with gr.Box():
53
+ gr.Markdown("### 🔽 Upload Your File")
54
+ file_input = gr.File(
55
+ label="Choose a PDF or Word file",
56
+ file_types=[".pdf", ".docx"],
57
+ type="file"
58
+ )
59
+
60
+ chatbot = gr.Chatbot(label="💬 Chat with Document")
61
+ question = gr.Textbox(label="Ask your question", placeholder="Type your question here...")
62
  state = gr.State([])
63
+
64
  question.submit(ask_question, [file_input, question, state], [question, chatbot])
65
 
66
  demo.launch()