m7n commited on
Commit
d6522f3
·
1 Parent(s): 96c83e7

set up caching dirs.

Browse files
Files changed (1) hide show
  1. app.py +16 -0
app.py CHANGED
@@ -2,7 +2,23 @@ import time
2
  print(f"Starting up: {time.strftime('%Y-%m-%d %H:%M:%S')}")
3
  # source openalex_env_map/bin/activate
4
  # Standard library imports
 
5
  import os
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
6
  from pathlib import Path
7
  from datetime import datetime
8
  from itertools import chain
 
2
  print(f"Starting up: {time.strftime('%Y-%m-%d %H:%M:%S')}")
3
  # source openalex_env_map/bin/activate
4
  # Standard library imports
5
+
6
  import os
7
+
8
+ #Enforce local cching:
9
+ # os.makedirs("./pip_cache", exist_ok=True)
10
+ # Pip:
11
+ os.makedirs("./pip_cache", exist_ok=True)
12
+ os.environ["PIP_CACHE_DIR"] = os.path.abspath("./pip_cache")
13
+ # MPL:
14
+ os.makedirs("./mpl_cache", exist_ok=True)
15
+ os.environ["MPLCONFIGDIR"] = os.path.abspath("./mpl_cache")
16
+ #Transformers
17
+ os.makedirs("./transformers_cache", exist_ok=True)
18
+ os.environ["TRANSFORMERS_CACHE"] = os.path.abspath("./transformers_cache")
19
+
20
+
21
+
22
  from pathlib import Path
23
  from datetime import datetime
24
  from itertools import chain