Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -6,6 +6,7 @@ from pathlib import Path
|
|
| 6 |
from pymongo import MongoClient
|
| 7 |
from urllib.parse import quote_plus
|
| 8 |
from document_chunker import DocumentChunker
|
|
|
|
| 9 |
|
| 10 |
# === MongoDB connection via Hugging Face secrets ===
|
| 11 |
user = quote_plus(os.getenv("MONGO_USER"))
|
|
@@ -99,7 +100,7 @@ if st.session_state.get("ready_to_process"):
|
|
| 99 |
os.remove(temp_path)
|
| 100 |
except Exception as e:
|
| 101 |
st.warning(f"⚠️ Could not delete temp file: {e}")
|
| 102 |
-
|
| 103 |
# Reset session
|
| 104 |
for key in ["uploaded_file_name", "collection_name", "is_grant_app", "temp_path", "ready_to_process"]:
|
| 105 |
st.session_state.pop(key, None)
|
|
|
|
| 6 |
from pymongo import MongoClient
|
| 7 |
from urllib.parse import quote_plus
|
| 8 |
from document_chunker import DocumentChunker
|
| 9 |
+
import time
|
| 10 |
|
| 11 |
# === MongoDB connection via Hugging Face secrets ===
|
| 12 |
user = quote_plus(os.getenv("MONGO_USER"))
|
|
|
|
| 100 |
os.remove(temp_path)
|
| 101 |
except Exception as e:
|
| 102 |
st.warning(f"⚠️ Could not delete temp file: {e}")
|
| 103 |
+
time.sleep(2)
|
| 104 |
# Reset session
|
| 105 |
for key in ["uploaded_file_name", "collection_name", "is_grant_app", "temp_path", "ready_to_process"]:
|
| 106 |
st.session_state.pop(key, None)
|