Spaces:
Sleeping
Sleeping
Decalred the cache folder for the transformers
Browse files
app.py
CHANGED
|
@@ -12,17 +12,17 @@ app = Flask(__name__)
|
|
| 12 |
CORS(app)
|
| 13 |
|
| 14 |
# --- Data File ---
|
| 15 |
-
DATA_DIR =
|
| 16 |
-
LOGS_CSV = os.path.join(DATA_DIR,
|
| 17 |
LOG_COLUMNS = ['date', 'exercise', 'water', 'reading', 'meditation', 'mood', 'journal_text']
|
| 18 |
|
| 19 |
# --- Helper Function ---
|
| 20 |
def init_log_file():
|
| 21 |
"""Creates the log file with headers if it doesn't exist."""
|
| 22 |
-
if not os.path.exists(
|
| 23 |
-
os.makedirs(
|
| 24 |
if not os.path.exists(LOGS_CSV):
|
| 25 |
-
df = pd.DataFrame(columns=
|
| 26 |
df.to_csv(LOGS_CSV, index=False)
|
| 27 |
|
| 28 |
|
|
|
|
| 12 |
CORS(app)
|
| 13 |
|
| 14 |
# --- Data File ---
|
| 15 |
+
DATA_DIR = "/tmp/data"
|
| 16 |
+
LOGS_CSV = os.path.join(DATA_DIR, "logs.csv")
|
| 17 |
LOG_COLUMNS = ['date', 'exercise', 'water', 'reading', 'meditation', 'mood', 'journal_text']
|
| 18 |
|
| 19 |
# --- Helper Function ---
|
| 20 |
def init_log_file():
|
| 21 |
"""Creates the log file with headers if it doesn't exist."""
|
| 22 |
+
if not os.path.exists(DATA_DIR):
|
| 23 |
+
os.makedirs(DATA_DIR, exist_ok=True)
|
| 24 |
if not os.path.exists(LOGS_CSV):
|
| 25 |
+
df = pd.DataFrame(columns=LOG_COLUMNS)
|
| 26 |
df.to_csv(LOGS_CSV, index=False)
|
| 27 |
|
| 28 |
|