swayamshetkar commited on
Commit
96f45fe
·
verified ·
1 Parent(s): 8c66073

Update utils/rmbg_model.py

Browse files
Files changed (1) hide show
  1. utils/rmbg_model.py +5 -6
utils/rmbg_model.py CHANGED
@@ -1,11 +1,10 @@
1
  import os
2
 
3
- # ✅ Set Hugging Face cache path inside /app (writeable)
4
- os.environ["HF_HOME"] = "/app/hf_cache"
5
- os.environ["TRANSFORMERS_CACHE"] = "/app/hf_cache"
6
- os.makedirs("/app/hf_cache", exist_ok=True)
7
-
8
-
9
 
10
 
11
  import torch
 
1
  import os
2
 
3
+ # ✅ Use a writable path inside Hugging Face Space
4
+ CACHE_DIR = "/data/hf_cache" # or "/tmp/hf_cache"
5
+ os.environ["HF_HOME"] = CACHE_DIR
6
+ os.environ["TRANSFORMERS_CACHE"] = CACHE_DIR
7
+ os.makedirs(CACHE_DIR, exist_ok=True)
 
8
 
9
 
10
  import torch