NotRev commited on
Commit
75db2a8
·
verified ·
1 Parent(s): db8428c

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +10 -10
Dockerfile CHANGED
@@ -1,26 +1,26 @@
1
- # Go back to a stable, general Python image
2
  FROM python:3.10
3
 
4
  WORKDIR /app
5
 
6
- # Install necessary system packages (build essentials are critical for compilation)
7
  RUN apt-get update && apt-get install -y \
8
  curl \
9
  git \
10
  build-essential \
11
  libffi-dev \
12
  libssl-dev \
13
- # Clean up to save space
14
  && rm -rf /var/lib/apt/lists/*
15
 
16
- # Install the problematic package (transformers/sentencepiece) using the special flag
17
- COPY requirements.txt ./
18
- # Install non-torch dependencies first
19
- RUN pip install --no-cache-dir --upgrade pip && \
20
- pip install --no-cache-dir -r requirements.txt
21
 
22
- # Install transformers *separately* using the special extra requirement
23
- RUN pip install --no-cache-dir "transformers[sentencepiece]"
 
24
 
25
  # Copy application source code (your streamlit_app.py)
26
  COPY src/ ./src/
 
1
+ # Go back to a stable, general Python image (3.10 is widely compatible)
2
  FROM python:3.10
3
 
4
  WORKDIR /app
5
 
6
+ # Install necessary system packages (build essentials are CRITICAL for sentencepiece compilation)
7
  RUN apt-get update && apt-get install -y \
8
  curl \
9
  git \
10
  build-essential \
11
  libffi-dev \
12
  libssl-dev \
13
+ # Clean up
14
  && rm -rf /var/lib/apt/lists/*
15
 
16
+ # 1. FORCE INSTALL: Install sentencepiece and transformers using the best method
17
+ # This is the dedicated fix for the ValueError you keep seeing
18
+ RUN pip install --no-cache-dir sentencepiece && \
19
+ pip install --no-cache-dir transformers
 
20
 
21
+ # 2. Install remaining dependencies (torch, etc.)
22
+ COPY requirements.txt ./
23
+ RUN pip install --no-cache-dir -r requirements.txt
24
 
25
  # Copy application source code (your streamlit_app.py)
26
  COPY src/ ./src/