Spaces:
Running
Running
File size: 1,094 Bytes
e3b077d 8b0f257 b2d5187 dad3b3d b2d5187 dad3b3d b2d5187 43dce44 dad3b3d ea450ca 8b0f257 b2d5187 43dce44 8b0f257 dad3b3d 8b0f257 e3b077d 43dce44 8b0f257 e3b077d dad3b3d 74054d6 43dce44 b2d5187 dad3b3d |
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 31 32 33 34 35 36 37 |
# Use a Debian-based Python image.
FROM python:3.10
# Set the working directory
WORKDIR /app
# Expose the port Streamlit runs on
EXPOSE 8501
# Copy the requirements file and application code
COPY requirements.txt .
COPY pdf_utils.py .
COPY merged.py .
COPY app.py .
# --- ROBUST DEPENDENCY INSTALLATION ---
# 1. Upgrade pip for stability
RUN pip install --upgrade pip
# 2. Install PyTorch ONLY, using the CPU-specific index.
RUN pip install torch --index-url https://download.pytorch.org/whl/cpu
# 3. Install all remaining complex and general dependencies using the standard index (PyPI).
# We install these explicitly here since they were previously excluded from requirements.txt
RUN pip install \
accelerate \
transformers \
huggingface-hub
# 4. Install the final, smaller dependencies from the trimmed requirements.txt
RUN pip install -r requirements.txt
RUN apt-get update && apt-get install -y fonts-dejavu
# --- END INSTALLATION ---
# Command to run the Streamlit application
CMD ["streamlit", "run", "app.py", "--server.port", "8501", "--server.address", "0.0.0.0"] |