LiamKhoaLe commited on
Commit
ee5a5e7
·
1 Parent(s): 6bba864
Files changed (2) hide show
  1. Dockerfile +3 -2
  2. requirements.txt +13 -13
Dockerfile CHANGED
@@ -21,7 +21,7 @@ WORKDIR /app
21
  COPY . .
22
 
23
  # Install Python dependencies
24
- RUN pip install --no-cache-dir -r requirements.txt
25
 
26
  # Hugging Face cache directories
27
  ENV HF_HOME="/home/user/.cache/huggingface"
@@ -37,7 +37,8 @@ ENV PRELOAD_TRANSLATORS="0"
37
  ENV EMBEDDING_HALF="0"
38
 
39
  # Preload embedding model and warmup
40
- RUN python /app/dw_model.py && python /app/warmup.py
 
41
 
42
  # Ensure ownership stays correct
43
  RUN chown -R user:user /app/model_cache
 
21
  COPY . .
22
 
23
  # Install Python dependencies
24
+ RUN pip install --upgrade pip && pip install --no-cache-dir -r requirements.txt
25
 
26
  # Hugging Face cache directories
27
  ENV HF_HOME="/home/user/.cache/huggingface"
 
37
  ENV EMBEDDING_HALF="0"
38
 
39
  # Preload embedding model and warmup
40
+ RUN test -f /app/dw_model.py && python /app/dw_model.py || true
41
+ RUN test -f /app/warmup.py && python /app/warmup.py || true
42
 
43
  # Ensure ownership stays correct
44
  RUN chown -R user:user /app/model_cache
requirements.txt CHANGED
@@ -1,13 +1,13 @@
1
- fastapi #==0.114.2
2
- uvicorn[standard] #==0.30.6
3
- python-multipart #==0.0.9
4
- pymongo #==4.8.0
5
- httpx #==0.27.2
6
- python-docx #==1.1.2
7
- PyMuPDF #==1.24.10
8
- pillow #==10.4.0
9
- transformers #==4.44.2
10
- torch #==2.4.0
11
- sentence-transformers#==3.1.1
12
- sumy #==0.11.0
13
- numpy #==1.26.4a
 
1
+ fastapi==0.114.2
2
+ uvicorn[standard]==0.30.6
3
+ python-multipart==0.0.9
4
+ pymongo==4.8.0
5
+ httpx==0.27.2
6
+ python-docx==1.1.2
7
+ PyMuPDF==1.24.10
8
+ pillow==10.4.0
9
+ transformers==4.44.2
10
+ torch==2.4.0
11
+ sentence-transformers==3.1.1
12
+ sumy==0.11.0
13
+ numpy==1.26.4