Spaces:
Runtime error
Runtime error
Update Dockerfile
Browse files- Dockerfile +11 -9
Dockerfile
CHANGED
|
@@ -6,29 +6,31 @@ WORKDIR /app
|
|
| 6 |
RUN apt-get update && apt-get install -y \
|
| 7 |
gcc \
|
| 8 |
python3-dev \
|
|
|
|
| 9 |
libgomp1 \
|
| 10 |
libopenblas-dev \
|
| 11 |
&& rm -rf /var/lib/apt/lists/*
|
| 12 |
|
| 13 |
-
# 2. First install
|
| 14 |
-
COPY requirements_minimal.txt .
|
| 15 |
RUN pip install --upgrade pip && \
|
| 16 |
-
pip install
|
| 17 |
|
| 18 |
-
# 3. Install
|
|
|
|
|
|
|
|
|
|
| 19 |
RUN pip install \
|
| 20 |
-
torch==2.3.1 --index-url https://download.pytorch.org/whl/cpu \
|
| 21 |
-
transformers==4.42.4 \
|
| 22 |
sentence-transformers==3.0.1 \
|
| 23 |
-
faiss-cpu==1.7.4
|
|
|
|
| 24 |
|
| 25 |
-
#
|
| 26 |
COPY requirements.txt .
|
| 27 |
RUN pip install -r requirements.txt --no-cache-dir && \
|
| 28 |
python -m spacy download en_core_web_sm && \
|
| 29 |
python -m nltk.downloader punkt wordnet
|
| 30 |
|
| 31 |
-
#
|
| 32 |
COPY . .
|
| 33 |
|
| 34 |
# Environment configuration
|
|
|
|
| 6 |
RUN apt-get update && apt-get install -y \
|
| 7 |
gcc \
|
| 8 |
python3-dev \
|
| 9 |
+
git \
|
| 10 |
libgomp1 \
|
| 11 |
libopenblas-dev \
|
| 12 |
&& rm -rf /var/lib/apt/lists/*
|
| 13 |
|
| 14 |
+
# 2. First install PyTorch with CPU-only version
|
|
|
|
| 15 |
RUN pip install --upgrade pip && \
|
| 16 |
+
pip install torch==2.3.1 --index-url https://download.pytorch.org/whl/cpu
|
| 17 |
|
| 18 |
+
# 3. Install Hugging Face transformers from source (more reliable)
|
| 19 |
+
RUN pip install git+https://github.com/huggingface/transformers@v4.42.4
|
| 20 |
+
|
| 21 |
+
# 4. Install other heavy dependencies
|
| 22 |
RUN pip install \
|
|
|
|
|
|
|
| 23 |
sentence-transformers==3.0.1 \
|
| 24 |
+
faiss-cpu==1.7.4 \
|
| 25 |
+
--no-cache-dir
|
| 26 |
|
| 27 |
+
# 5. Copy and install remaining requirements
|
| 28 |
COPY requirements.txt .
|
| 29 |
RUN pip install -r requirements.txt --no-cache-dir && \
|
| 30 |
python -m spacy download en_core_web_sm && \
|
| 31 |
python -m nltk.downloader punkt wordnet
|
| 32 |
|
| 33 |
+
# 6. Copy application files
|
| 34 |
COPY . .
|
| 35 |
|
| 36 |
# Environment configuration
|