Spaces:
Sleeping

doluong6 commited on
Commit
559f158
·
verified ·
1 Parent(s): 1ac29c1

Update routes/tai_pdf.py

Browse files
Files changed (1) hide show
  1. routes/tai_pdf.py +4 -1
routes/tai_pdf.py CHANGED
@@ -4,9 +4,12 @@ from huggingface_hub import hf_hub_download, list_repo_files
4
  from unidecode import unidecode
5
  import os, traceback
6
 
7
- # ✅ Đặt biến môi trường để không bị lỗi permission
8
  os.environ["HF_HUB_CACHE"] = "/tmp/hf_cache"
 
9
  os.makedirs("/tmp/hf_cache", exist_ok=True)
 
 
10
 
11
  router = APIRouter()
12
 
 
4
  from unidecode import unidecode
5
  import os, traceback
6
 
7
+ # ✅ Tạo thư mục cache an toàn trong môi trường Hugging Face Space
8
  os.environ["HF_HUB_CACHE"] = "/tmp/hf_cache"
9
+ os.environ["TRANSFORMERS_CACHE"] = "/tmp/transformers_cache" # 👈 thêm dòng này
10
  os.makedirs("/tmp/hf_cache", exist_ok=True)
11
+ os.makedirs("/tmp/transformers_cache", exist_ok=True)
12
+
13
 
14
  router = APIRouter()
15