DrishtiSharma commited on
Commit
9ea7c64
Β·
verified Β·
1 Parent(s): b255649

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -1
app.py CHANGED
@@ -151,7 +151,12 @@ st.write("πŸ“‚ **Vector Store Created:**", st.session_state.vector_created)
151
 
152
 
153
  # ----------------- Query Input -----------------
154
- query = st.text_input("πŸ” Ask a question about the document:")
 
 
 
 
 
155
  if query:
156
  with st.spinner("πŸ”„ Retrieving relevant context..."):
157
  retriever = st.session_state.vector_store.as_retriever(search_type="similarity", search_kwargs={"k": 5})
 
151
 
152
 
153
  # ----------------- Query Input -----------------
154
+ # Ensure the query input appears ONLY after the document is fully processed
155
+ if st.session_state.pdf_loaded and st.session_state.chunked and st.session_state.vector_created:
156
+ query = st.text_input("πŸ” Ask a question about the document:")
157
+ else:
158
+ st.info("πŸ“₯ Please wait for the PDF to be processed before asking a question.")
159
+
160
  if query:
161
  with st.spinner("πŸ”„ Retrieving relevant context..."):
162
  retriever = st.session_state.vector_store.as_retriever(search_type="similarity", search_kwargs={"k": 5})