negi2725 commited on
Commit
b1c7b4b
·
verified ·
1 Parent(s): 6e641d9

Update main.py

Browse files
Files changed (1) hide show
  1. main.py +6 -0
main.py CHANGED
@@ -1,5 +1,11 @@
1
  import os
2
 
 
 
 
 
 
 
3
  # Redirect Hugging Face cache to local project directory (not /)
4
  os.environ["HF_HOME"] = "./hf_cache"
5
  os.environ["TRANSFORMERS_CACHE"] = "./hf_cache"
 
1
  import os
2
 
3
+ # Hugging Face Spaces: redirect cache to /tmp
4
+ os.environ["HF_HUB_CACHE"] = "/tmp/hf_cache"
5
+ os.environ["TRANSFORMERS_CACHE"] = "/tmp/hf_cache"
6
+
7
+ import os
8
+
9
  # Redirect Hugging Face cache to local project directory (not /)
10
  os.environ["HF_HOME"] = "./hf_cache"
11
  os.environ["TRANSFORMERS_CACHE"] = "./hf_cache"