Spaces:
Sleeping
Sleeping
Update Dockerfile
Browse files- 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
|
| 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 |
-
#
|
| 17 |
-
|
| 18 |
-
|
| 19 |
-
|
| 20 |
-
pip install --no-cache-dir -r requirements.txt
|
| 21 |
|
| 22 |
-
# Install
|
| 23 |
-
|
|
|
|
| 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/
|