GHarshasri commited on
Commit
2419b2c
·
verified ·
1 Parent(s): 293338f

Update src/streamlit_app.py

Browse files
Files changed (1) hide show
  1. 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
- UPLOAD_FOLDER = "uploads"
 
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
- if not os.path.exists(UPLOAD_FOLDER):
16
- os.makedirs(UPLOAD_FOLDER)
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"],