Spaces:
Build error
Build error
Update app.py
Browse files
app.py
CHANGED
@@ -151,13 +151,15 @@ st.write("π **Vector Store Created:**", st.session_state.vector_created)
|
|
151 |
|
152 |
|
153 |
# ----------------- Query Input -----------------
|
154 |
-
query =
|
155 |
-
|
|
|
156 |
if st.session_state.pdf_loaded and st.session_state.chunked and st.session_state.vector_created:
|
157 |
query = st.text_input("π Ask a question about the document:")
|
158 |
-
|
159 |
-
|
160 |
-
|
|
|
161 |
if query:
|
162 |
with st.spinner("π Retrieving relevant context..."):
|
163 |
retriever = st.session_state.vector_store.as_retriever(search_type="similarity", search_kwargs={"k": 4})
|
|
|
151 |
|
152 |
|
153 |
# ----------------- Query Input -----------------
|
154 |
+
query = None
|
155 |
+
|
156 |
+
# Show input box ONLY when processing is fully done
|
157 |
if st.session_state.pdf_loaded and st.session_state.chunked and st.session_state.vector_created:
|
158 |
query = st.text_input("π Ask a question about the document:")
|
159 |
+
|
160 |
+
elif not st.session_state.pdf_path:
|
161 |
+
st.info("β¬οΈ Please upload or provide a PDF URL first.") # Show only if no PDF is provided
|
162 |
+
|
163 |
if query:
|
164 |
with st.spinner("π Retrieving relevant context..."):
|
165 |
retriever = st.session_state.vector_store.as_retriever(search_type="similarity", search_kwargs={"k": 4})
|