Spaces:
Sleeping
Sleeping
fix: Vercel serverless platform pathing (read-only file system fix)
Browse files
config.py
CHANGED
|
@@ -44,10 +44,15 @@ PENALTY_UNKNOWN_ACTION = -5 # Unknown action type
|
|
| 44 |
# ---------------------------------------------------------------------------
|
| 45 |
# File paths
|
| 46 |
# ---------------------------------------------------------------------------
|
|
|
|
| 47 |
|
| 48 |
-
EPISODES_FILE = "episodes.json"
|
| 49 |
-
ANSWERS_FILE = "answers.json"
|
| 50 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 51 |
CHECKPOINT_FILE = os.path.join(RUNS_DIR, "checkpoint.json")
|
| 52 |
|
| 53 |
# ---------------------------------------------------------------------------
|
|
|
|
| 44 |
# ---------------------------------------------------------------------------
|
| 45 |
# File paths
|
| 46 |
# ---------------------------------------------------------------------------
|
| 47 |
+
BASE_DIR = os.path.dirname(os.path.abspath(__file__))
|
| 48 |
|
| 49 |
+
EPISODES_FILE = os.path.join(BASE_DIR, "episodes.json")
|
| 50 |
+
ANSWERS_FILE = os.path.join(BASE_DIR, "answers.json")
|
| 51 |
+
|
| 52 |
+
if os.environ.get("VERCEL"):
|
| 53 |
+
RUNS_DIR = "/tmp/runs"
|
| 54 |
+
else:
|
| 55 |
+
RUNS_DIR = os.path.join(BASE_DIR, "runs")
|
| 56 |
CHECKPOINT_FILE = os.path.join(RUNS_DIR, "checkpoint.json")
|
| 57 |
|
| 58 |
# ---------------------------------------------------------------------------
|