Spaces:
Sleeping
Sleeping
File size: 934 Bytes
9a45d1f ab7de11 50910bf 9a45d1f 200bbd8 50910bf 9a45d1f 200bbd8 a652368 200bbd8 50910bf 9a45d1f 200bbd8 d7fee50 9a45d1f 98abd28 200bbd8 9a45d1f 50910bf 9a45d1f 98abd28 200bbd8 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 | # 1. Use the stable PyTorch 2.0.1 base image
FROM pytorch/pytorch:2.0.1-cuda11.7-cudnn8-runtime
# Set working directory
WORKDIR /app
# Install system dependencies
RUN apt-get update && apt-get install -y \
curl \
git \
build-essential \
&& rm -rf /var/lib/apt/lists/*
# 2. Copy requirements
COPY requirements.txt ./
# 3. CRITICAL: Force reinstall to ensure we get Transformers 4.32.0 and NumPy 1.24.4
# This overwrites any pre-installed versions in the base image
RUN pip install --no-cache-dir --upgrade --force-reinstall -r requirements.txt
# 4. Download spaCy model
RUN python3 -m spacy download en_core_web_sm
# 5. Copy your source code (Ensure your code is in src/streamlit_app.py)
COPY src/ ./src/
# 6. Expose port and run
EXPOSE 8501
HEALTHCHECK CMD curl --fail http://localhost:8501/_stcore/health
ENTRYPOINT ["streamlit", "run", "src/streamlit_app.py", "--server.port=8501", "--server.address=0.0.0.0"] |