Spaces:
Build error
Build error
Update app.py
Browse files
app.py
CHANGED
|
@@ -151,14 +151,15 @@ st.write("π **Vector Store Created:**", st.session_state.vector_created)
|
|
| 151 |
|
| 152 |
|
| 153 |
# ----------------- Query Input -----------------
|
| 154 |
-
query = None
|
| 155 |
|
| 156 |
-
#
|
| 157 |
-
if
|
| 158 |
-
|
| 159 |
|
| 160 |
-
|
| 161 |
-
|
|
|
|
| 162 |
|
| 163 |
if query:
|
| 164 |
with st.spinner("π Retrieving relevant context..."):
|
|
|
|
| 151 |
|
| 152 |
|
| 153 |
# ----------------- Query Input -----------------
|
| 154 |
+
query = None
|
| 155 |
|
| 156 |
+
# Notify user if no PDF is provided in an aesthetic manner
|
| 157 |
+
if not st.session_state.pdf_path:
|
| 158 |
+
st.warning("β οΈ **No PDF detected!** Please enter a valid URL or upload a PDF file to proceed.", icon="β οΈ")
|
| 159 |
|
| 160 |
+
# Show input box ONLY when processing is fully complete
|
| 161 |
+
elif st.session_state.pdf_loaded and st.session_state.chunked and st.session_state.vector_created:
|
| 162 |
+
query = st.text_input("π Ask a question about the document:")
|
| 163 |
|
| 164 |
if query:
|
| 165 |
with st.spinner("π Retrieving relevant context..."):
|