vhr1007 commited on
Commit
7ff8858
·
verified ·
1 Parent(s): 1f3498e

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -0
app.py CHANGED
@@ -16,6 +16,10 @@ load_dotenv()
16
  app = FastAPI()
17
 
18
  os.environ["HF_HOME"] = "/tmp/huggingface_cache"
 
 
 
 
19
 
20
  # Ensure the cache directory exists
21
  cache_dir = os.environ["HF_HOME"]
 
16
  app = FastAPI()
17
 
18
  os.environ["HF_HOME"] = "/tmp/huggingface_cache"
19
+ # Ensure the cache directory exists
20
+ cache_dir = os.environ["TRANSFORMERS_CACHE"]
21
+ if not os.path.exists(cache_dir):
22
+ os.makedirs(cache_dir)
23
 
24
  # Ensure the cache directory exists
25
  cache_dir = os.environ["HF_HOME"]