Spaces:
Runtime error
Runtime error
File size: 1,967 Bytes
e15b087 0965780 cb33a1e c94624b 443efba cb33a1e 76f7f2a cb33a1e c94624b cb33a1e fbe1ab9 4e5a345 443efba fbe1ab9 4e5a345 7d37772 443efba 6261769 fbe1ab9 4e5a345 443efba cb33a1e 4e5a345 0965780 ad9db23 f7e06e0 0965780 cb33a1e 0965780 f354c49 |
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 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 |
FROM nvidia/cuda:12.1.0-cudnn8-devel-ubuntu22.04
# Avoid apt interactive prompts
ENV DEBIAN_FRONTEND=noninteractive \
PATH=/opt/conda/bin:$PATH \
CUDA_HOME=/usr/local/cuda
# Install system packages
RUN apt-get update && apt-get install -y \
wget git build-essential \
libgl1-mesa-glx libgl1-mesa-dri xvfb ffmpeg \
&& rm -rf /var/lib/apt/lists/*
# Install Miniconda
RUN wget --quiet https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh -O /tmp/miniconda.sh && \
bash /tmp/miniconda.sh -b -p /opt/conda && \
rm /tmp/miniconda.sh && \
conda clean -afy
# Remove ALL Anaconda default channels (system + user configs)
RUN rm -f /opt/conda/.condarc && \
conda config --system --remove-key channels || true && \
conda config --remove-key channels || true && \
conda config --system --add channels conda-forge && \
conda config --system --set channel_priority strict && \
conda config --add channels conda-forge && \
conda config --set channel_priority strict
# Ensure build tools are present
RUN apt-get update && apt-get install -y --no-install-recommends \
ninja-build build-essential cmake git python3-dev && \
rm -rf /var/lib/apt/lists/*
# Install packaging helpers
RUN pip install --upgrade pip setuptools wheel packaging ninja
# Uninstall any prebuilt flash-attn
ENV CONDA_FORGE=1 \
CONDA_AUTO_UPDATE_CONDA=false
RUN conda create --override-channels -n appenv -c conda-forge python=3.10 ffmpeg=7 -y && conda clean -afy
SHELL ["conda", "run", "-n", "appenv", "/bin/bash", "-c"]
# Copy requirements
WORKDIR /workspace
COPY requirements.txt .
# Pre-install torch so flash-attn doesn't fail
RUN pip install --upgrade pip && \
pip install torch==2.6 torchvision torchaudio --extra-index-url https://download.pytorch.org/whl/cu121
# Copy project code
COPY . .
# Run app
CMD ["conda", "run", "--no-capture-output", "-n", "appenv", "python", "finetune/gradio_app.py"]
|