Spaces:
Build error
Build error
Update app.py
Browse files
app.py
CHANGED
@@ -151,7 +151,12 @@ st.write("π **Vector Store Created:**", st.session_state.vector_created)
|
|
151 |
|
152 |
|
153 |
# ----------------- Query Input -----------------
|
154 |
-
|
|
|
|
|
|
|
|
|
|
|
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})
|