Elaineyy commited on
Commit
351eb5f
Β·
verified Β·
1 Parent(s): f513163

Update server.py

Browse files
Files changed (1) hide show
  1. server.py +2 -2
server.py CHANGED
@@ -6,11 +6,11 @@ import torch
6
 
7
  app = FastAPI()
8
 
9
- # βœ… Fix: Use `/tmp` as the cache directory (Hugging Face Spaces allows writing here)
10
  os.environ["TRANSFORMERS_CACHE"] = "/tmp"
11
  os.environ["HF_HOME"] = "/tmp"
12
 
13
- # βœ… Ensure the `/tmp` directory exists
14
  if not os.path.exists("/tmp"):
15
  os.makedirs("/tmp")
16
 
 
6
 
7
  app = FastAPI()
8
 
9
+ # βœ… Fix: Set writable cache directory for Hugging Face models
10
  os.environ["TRANSFORMERS_CACHE"] = "/tmp"
11
  os.environ["HF_HOME"] = "/tmp"
12
 
13
+ # βœ… Ensure cache directory exists
14
  if not os.path.exists("/tmp"):
15
  os.makedirs("/tmp")
16