Juna190825 commited on
Commit
31d4342
·
verified ·
1 Parent(s): bba5e4f

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +9 -4
Dockerfile CHANGED
@@ -1,5 +1,5 @@
1
 
2
- FROM python:3.9-slim # Lightweight CPU-only base
3
 
4
  # Install system dependencies
5
  RUN apt-get update && apt-get install -y \
@@ -8,7 +8,10 @@ RUN apt-get update && apt-get install -y \
8
  g++ \
9
  && rm -rf /var/lib/apt/lists/*
10
 
11
- # Install Python packages (CPU-only versions)
 
 
 
12
  RUN pip install --no-cache-dir \
13
  torch==2.1.2+cpu -f https://download.pytorch.org/whl/torch_stable.html \
14
  transformers==4.36.0 \
@@ -17,8 +20,7 @@ RUN pip install --no-cache-dir \
17
  huggingface-hub==0.19.4 \
18
  gradio==3.50.2 \
19
  datasets==2.15.0 \
20
- safetensors==0.4.1 \
21
- tenacity==8.2.3 # Explicitly added with version
22
 
23
  # Configure cache
24
  ENV TRANSFORMERS_CACHE="/cache/models"
@@ -28,4 +30,7 @@ RUN mkdir -p /cache/models /cache/datasets
28
  WORKDIR /app
29
  COPY . /app
30
 
 
 
 
31
  CMD ["python", "app.py"]
 
1
 
2
+ FROM python:3.9-slim
3
 
4
  # Install system dependencies
5
  RUN apt-get update && apt-get install -y \
 
8
  g++ \
9
  && rm -rf /var/lib/apt/lists/*
10
 
11
+ # First install tenacity separately with --force-reinstall
12
+ RUN pip install --no-cache-dir --force-reinstall tenacity==8.2.3
13
+
14
+ # Then install other packages
15
  RUN pip install --no-cache-dir \
16
  torch==2.1.2+cpu -f https://download.pytorch.org/whl/torch_stable.html \
17
  transformers==4.36.0 \
 
20
  huggingface-hub==0.19.4 \
21
  gradio==3.50.2 \
22
  datasets==2.15.0 \
23
+ safetensors==0.4.1
 
24
 
25
  # Configure cache
26
  ENV TRANSFORMERS_CACHE="/cache/models"
 
30
  WORKDIR /app
31
  COPY . /app
32
 
33
+ # Add this right before your CMD
34
+ # RUN python -c "import sys, subprocess; subprocess.check_call([sys.executable, '-m', 'pip', 'install', 'tenacity==8.2.3'])"
35
+
36
  CMD ["python", "app.py"]