Spaces:
Build error
Build error
Update app.py
Browse files
app.py
CHANGED
|
@@ -153,21 +153,24 @@ if st.session_state.chunked and not st.session_state.vector_created:
|
|
| 153 |
# ----------------- Query Input -----------------
|
| 154 |
query = None
|
| 155 |
|
| 156 |
-
#
|
| 157 |
-
|
|
|
|
|
|
|
|
|
|
| 158 |
st.info("π₯ **Please upload a PDF or enter a valid URL to proceed.**")
|
| 159 |
|
| 160 |
-
#
|
| 161 |
-
elif
|
| 162 |
st.warning("β οΈ **PDF detected! Click 'Download and Process PDF' to start processing.**")
|
| 163 |
|
| 164 |
-
#
|
| 165 |
elif st.session_state.get("trigger_download", False) and (
|
| 166 |
not st.session_state.pdf_loaded or not st.session_state.chunked or not st.session_state.vector_created
|
| 167 |
):
|
| 168 |
st.info("β³ **Processing your document... Please wait.**")
|
| 169 |
|
| 170 |
-
# Step 4: Processing Complete, Ready for Questions
|
| 171 |
elif st.session_state.pdf_loaded and st.session_state.chunked and st.session_state.vector_created:
|
| 172 |
st.success("π **Processing complete! You can now ask questions.**")
|
| 173 |
query = st.text_input("π **Ask a question about the document:**")
|
|
|
|
| 153 |
# ----------------- Query Input -----------------
|
| 154 |
query = None
|
| 155 |
|
| 156 |
+
# Check if a valid PDF URL has been entered (but not processed yet)
|
| 157 |
+
pdf_url_entered = bool(st.session_state.get("pdf_url")) # Checks if text is in the input box
|
| 158 |
+
|
| 159 |
+
# No PDF Provided Yet
|
| 160 |
+
if not st.session_state.pdf_path and not pdf_url_entered:
|
| 161 |
st.info("π₯ **Please upload a PDF or enter a valid URL to proceed.**")
|
| 162 |
|
| 163 |
+
# PDF URL Exists but Not Processed Yet (Only show if URL exists but hasn't been downloaded)
|
| 164 |
+
elif pdf_url_entered and not st.session_state.pdf_loaded:
|
| 165 |
st.warning("β οΈ **PDF detected! Click 'Download and Process PDF' to start processing.**")
|
| 166 |
|
| 167 |
+
# Processing in Progress
|
| 168 |
elif st.session_state.get("trigger_download", False) and (
|
| 169 |
not st.session_state.pdf_loaded or not st.session_state.chunked or not st.session_state.vector_created
|
| 170 |
):
|
| 171 |
st.info("β³ **Processing your document... Please wait.**")
|
| 172 |
|
| 173 |
+
# β
Step 4: Processing Complete, Ready for Questions
|
| 174 |
elif st.session_state.pdf_loaded and st.session_state.chunked and st.session_state.vector_created:
|
| 175 |
st.success("π **Processing complete! You can now ask questions.**")
|
| 176 |
query = st.text_input("π **Ask a question about the document:**")
|