JohnDoee commited on
Commit
8aec507
·
1 Parent(s): 25b797a

Update main.py

Browse files
Files changed (1) hide show
  1. main.py +3 -2
main.py CHANGED
@@ -7,8 +7,9 @@ from langdetect import detect, DetectorFactory
7
  # Ensure consistent language detection results
8
  DetectorFactory.seed = 0
9
 
10
- # Set HF cache directory instead of TRANSFORMERS_CACHE
11
- os.environ["HF_HOME"] = "/app/cache"
 
12
 
13
  app = FastAPI()
14
 
 
7
  # Ensure consistent language detection results
8
  DetectorFactory.seed = 0
9
 
10
+ # Set Hugging Face cache directory to a writable location
11
+ os.environ["HF_HOME"] = "/tmp/huggingface"
12
+ os.makedirs(os.environ["HF_HOME"], exist_ok=True) # Ensure the directory exists
13
 
14
  app = FastAPI()
15