vumichien commited on
Commit
0500396
·
1 Parent(s): 4e4ac38
Files changed (2) hide show
  1. Dockerfile +3 -1
  2. auth.py +1 -1
Dockerfile CHANGED
@@ -17,6 +17,8 @@ ENV MPLCONFIGDIR=/tmp/matplotlib-cache
17
  ENV TRANSFORMERS_CACHE=/tmp/huggingface-cache
18
  ENV HF_HOME=/tmp/huggingface-cache
19
  ENV HF_DATASETS_CACHE=/tmp/huggingface-cache
 
 
20
 
21
  # Copy requirements từ project hiện tại
22
  COPY requirements.txt .
@@ -53,4 +55,4 @@ USER appuser
53
 
54
  # Chạy ứng dụng với Uvicorn
55
  # Lưu ý: Hugging Face Spaces sử dụng port 7860
56
- CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"]
 
17
  ENV TRANSFORMERS_CACHE=/tmp/huggingface-cache
18
  ENV HF_HOME=/tmp/huggingface-cache
19
  ENV HF_DATASETS_CACHE=/tmp/huggingface-cache
20
+ ENV PYTHONUNBUFFERED=1
21
+ ENV LOG_LEVEL=DEBUG
22
 
23
  # Copy requirements từ project hiện tại
24
  COPY requirements.txt .
 
55
 
56
  # Chạy ứng dụng với Uvicorn
57
  # Lưu ý: Hugging Face Spaces sử dụng port 7860
58
+ CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860", "--log-level", "debug"]
auth.py CHANGED
@@ -10,7 +10,7 @@ from typing import Annotated, Optional
10
  from jwt.exceptions import InvalidTokenError
11
 
12
  pwd_context = CryptContext(schemes=["bcrypt"], deprecated="auto")
13
- oauth2_scheme = OAuth2PasswordBearer(tokenUrl="/token")
14
 
15
  # Authentication helper functions
16
  def verify_password(plain_password, hashed_password):
 
10
  from jwt.exceptions import InvalidTokenError
11
 
12
  pwd_context = CryptContext(schemes=["bcrypt"], deprecated="auto")
13
+ oauth2_scheme = OAuth2PasswordBearer(tokenUrl="token", auto_error=True)
14
 
15
  # Authentication helper functions
16
  def verify_password(plain_password, hashed_password):