eduagarcia commited on
Commit
d6353b5
1 Parent(s): a68692e

Update src/envs.py

Browse files
Files changed (1) hide show
  1. src/envs.py +8 -0
src/envs.py CHANGED
@@ -42,6 +42,14 @@ PRIVATE_RESULTS_REPO = RESULTS_REPO
42
  IS_PUBLIC = str2bool(get_config("IS_PUBLIC", True))
43
 
44
  CACHE_PATH=get_config("HF_HOME", ".")
 
 
 
 
 
 
 
 
45
 
46
  EVAL_REQUESTS_PATH = os.path.join(CACHE_PATH, "eval-queue")
47
  EVAL_RESULTS_PATH = os.path.join(CACHE_PATH, "eval-results")
 
42
  IS_PUBLIC = str2bool(get_config("IS_PUBLIC", True))
43
 
44
  CACHE_PATH=get_config("HF_HOME", ".")
45
+ os.environ["HF_HOME"] = CACHE_PATH
46
+
47
+ if not os.access(CACHE_PATH, os.W_OK):
48
+ print(f"No write access to HF_HOME: {CACHE_PATH}. Resetting to current directory.")
49
+ CACHE_PATH = "."
50
+ os.environ["HF_HOME"] = CACHE_PATH
51
+ else:
52
+ print(f"Write access confirmed for HF_HOME"
53
 
54
  EVAL_REQUESTS_PATH = os.path.join(CACHE_PATH, "eval-queue")
55
  EVAL_RESULTS_PATH = os.path.join(CACHE_PATH, "eval-results")