Alina Lozovskaia commited on
Commit
e243a5f
1 Parent(s): 6a5081f

debugging CACHE_PATH in envs.py

Browse files
Files changed (1) hide show
  1. src/envs.py +4 -0
src/envs.py CHANGED
@@ -23,6 +23,10 @@ IS_PUBLIC = bool(os.environ.get("IS_PUBLIC", True))
23
 
24
  CACHE_PATH = os.getenv("HF_HOME", ".")
25
 
 
 
 
 
26
  # DEBUG STARTS
27
  print(f"Initial CACHE_PATH set to: {CACHE_PATH}")
28
 
 
23
 
24
  CACHE_PATH = os.getenv("HF_HOME", ".")
25
 
26
+ if not os.access(CACHE_PATH, os.W_OK | os.X_OK):
27
+ print(f"No write and execute rights to: {CACHE_PATH}, using default CACHE_PATH")
28
+ CACHE_PATH = "."
29
+
30
  # DEBUG STARTS
31
  print(f"Initial CACHE_PATH set to: {CACHE_PATH}")
32