Spaces:
Sleeping
Sleeping
Update src/streamlit_app.py
Browse files- src/streamlit_app.py +4 -5
src/streamlit_app.py
CHANGED
@@ -7,15 +7,14 @@ from datetime import datetime
|
|
7 |
|
8 |
# ====== Setup ======
|
9 |
USERS = {}
|
10 |
-
|
|
|
11 |
MEDIA_FOLDER = os.path.join(UPLOAD_FOLDER, "feedback_media")
|
12 |
FEEDBACK_FILE = os.path.join(UPLOAD_FOLDER, "feedback.csv")
|
13 |
|
14 |
# Create directories if they don't exist
|
15 |
-
|
16 |
-
|
17 |
-
if not os.path.exists(MEDIA_FOLDER):
|
18 |
-
os.makedirs(MEDIA_FOLDER)
|
19 |
|
20 |
STATES = {
|
21 |
"Telangana": ["Hyderabad", "Warangal", "Nizamabad", "Karimnagar", "Khammam"],
|
|
|
7 |
|
8 |
# ====== Setup ======
|
9 |
USERS = {}
|
10 |
+
# Use /tmp directory for Hugging Face Spaces, which is writable
|
11 |
+
UPLOAD_FOLDER = "/tmp/uploads"
|
12 |
MEDIA_FOLDER = os.path.join(UPLOAD_FOLDER, "feedback_media")
|
13 |
FEEDBACK_FILE = os.path.join(UPLOAD_FOLDER, "feedback.csv")
|
14 |
|
15 |
# Create directories if they don't exist
|
16 |
+
os.makedirs(UPLOAD_FOLDER, exist_ok=True)
|
17 |
+
os.makedirs(MEDIA_FOLDER, exist_ok=True)
|
|
|
|
|
18 |
|
19 |
STATES = {
|
20 |
"Telangana": ["Hyderabad", "Warangal", "Nizamabad", "Karimnagar", "Khammam"],
|