NotRev commited on
Commit
45b9d31
·
verified ·
1 Parent(s): 43e7826

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +11 -7
Dockerfile CHANGED
@@ -1,22 +1,26 @@
1
- # Use the official PyTorch base image with a confirmed tag (CPU-only, Python 3.10)
2
- FROM pytorch/pytorch:2.0.1-cpu-py310
3
 
4
  WORKDIR /app
5
 
6
- # Install necessary system packages for Streamlit and Git
7
  RUN apt-get update && apt-get install -y \
8
  curl \
9
  git \
 
10
  libffi-dev \
11
  libssl-dev \
 
12
  && rm -rf /var/lib/apt/lists/*
13
 
14
- # Copy and install ONLY non-torch dependencies (torch is already installed)
15
  COPY requirements.txt ./
16
- # Install non-torch dependencies, ignoring any torch/cuda mentions
17
- RUN pip3 install --no-cache-dir --force-reinstall -r requirements.txt
 
 
18
 
19
- # Copy application source code
20
  COPY src/ ./src/
21
 
22
  EXPOSE 8501
 
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 sentencepiece)
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, then install transformers with sentencepiece extra
19
+ RUN pip install --no-cache-dir --upgrade pip && \
20
+ pip install --no-cache-dir "transformers[sentencepiece]" && \
21
+ pip install --no-cache-dir -r requirements.txt
22
 
23
+ # Copy application source code (your streamlit_app.py)
24
  COPY src/ ./src/
25
 
26
  EXPOSE 8501