Spaces:
Running
on
CPU Upgrade
Running
on
CPU Upgrade
Alina Lozovskaia
commited on
Commit
•
63dac32
1
Parent(s):
79ad1ad
fixing envs CACHE_PATH check
Browse files- src/envs.py +4 -1
src/envs.py
CHANGED
@@ -17,7 +17,10 @@ IS_PUBLIC = bool(os.environ.get("IS_PUBLIC", True))
|
|
17 |
|
18 |
CACHE_PATH = os.getenv("HF_HOME", ".")
|
19 |
# Check if the CACHE_PATH is a directory and if we have write access, if not set to '.'
|
20 |
-
if not os.path.isdir(CACHE_PATH)
|
|
|
|
|
|
|
21 |
CACHE_PATH = "."
|
22 |
|
23 |
EVAL_REQUESTS_PATH = os.path.join(CACHE_PATH, "eval-queue")
|
|
|
17 |
|
18 |
CACHE_PATH = os.getenv("HF_HOME", ".")
|
19 |
# Check if the CACHE_PATH is a directory and if we have write access, if not set to '.'
|
20 |
+
if not os.path.isdir(CACHE_PATH):
|
21 |
+
os.makedirs(CACHE_PATH, exist_ok=True) # Create directory if it doesn't exist
|
22 |
+
|
23 |
+
if not os.access(CACHE_PATH, os.W_OK):
|
24 |
CACHE_PATH = "."
|
25 |
|
26 |
EVAL_REQUESTS_PATH = os.path.join(CACHE_PATH, "eval-queue")
|