Spaces:
Build error
Build error
Update app.py
Browse files
app.py
CHANGED
@@ -151,15 +151,24 @@ if st.session_state.chunked and not st.session_state.vector_created:
|
|
151 |
|
152 |
|
153 |
# ----------------- Query Input -----------------
|
154 |
-
query = None
|
155 |
|
156 |
-
#
|
157 |
if not st.session_state.pdf_path:
|
158 |
-
st.
|
159 |
-
|
160 |
-
#
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
161 |
elif st.session_state.pdf_loaded and st.session_state.chunked and st.session_state.vector_created:
|
162 |
-
|
|
|
163 |
|
164 |
if query:
|
165 |
with st.spinner("π Retrieving relevant context..."):
|
|
|
151 |
|
152 |
|
153 |
# ----------------- Query Input -----------------
|
154 |
+
query = None
|
155 |
|
156 |
+
# Step 1: No PDF Provided Yet
|
157 |
if not st.session_state.pdf_path:
|
158 |
+
st.info("π₯ **Please upload a PDF or enter a valid URL to proceed.**")
|
159 |
+
|
160 |
+
# Step 2: PDF URL Exists but Not Processed Yet
|
161 |
+
elif st.session_state.pdf_path and not st.session_state.pdf_loaded:
|
162 |
+
st.warning("β οΈ **PDF detected! Click 'Download and Process PDF' to start processing.**")
|
163 |
+
|
164 |
+
# Step 3: Processing in Progress
|
165 |
+
elif not st.session_state.chunked or not st.session_state.vector_created:
|
166 |
+
st.info("β³ **Processing your document... Please wait.**")
|
167 |
+
|
168 |
+
# Step 4: Processing Complete, Ready for Questions
|
169 |
elif st.session_state.pdf_loaded and st.session_state.chunked and st.session_state.vector_created:
|
170 |
+
st.success("π **Processing complete! You can now ask questions.**")
|
171 |
+
query = st.text_input("π **Ask a question about the document:**")
|
172 |
|
173 |
if query:
|
174 |
with st.spinner("π Retrieving relevant context..."):
|