Spaces:
Running
Running
Remove Dockerfile to use Gradio SDK
Browse files- Dockerfile +0 -74
Dockerfile
DELETED
|
@@ -1,74 +0,0 @@
|
|
| 1 |
-
FROM nvidia/cuda:12.1.0-devel-ubuntu22.04
|
| 2 |
-
|
| 3 |
-
# Set environment variables
|
| 4 |
-
ENV DEBIAN_FRONTEND=noninteractive \
|
| 5 |
-
PYTHONUNBUFFERED=1 \
|
| 6 |
-
PYTHON_VERSION=3.10 \
|
| 7 |
-
TORCHVISION_DISABLE_META_REGISTRATIONS=1
|
| 8 |
-
|
| 9 |
-
# Install system dependencies
|
| 10 |
-
RUN apt-get update && apt-get install -y \
|
| 11 |
-
python${PYTHON_VERSION} \
|
| 12 |
-
python${PYTHON_VERSION}-dev \
|
| 13 |
-
python3-pip \
|
| 14 |
-
git \
|
| 15 |
-
git-lfs \
|
| 16 |
-
ffmpeg \
|
| 17 |
-
build-essential \
|
| 18 |
-
libsndfile1 \
|
| 19 |
-
ninja-build \
|
| 20 |
-
wget \
|
| 21 |
-
&& rm -rf /var/lib/apt/lists/* \
|
| 22 |
-
&& git lfs install
|
| 23 |
-
|
| 24 |
-
# Set Python 3.10 as default
|
| 25 |
-
RUN update-alternatives --install /usr/bin/python python /usr/bin/python${PYTHON_VERSION} 1 && \
|
| 26 |
-
update-alternatives --install /usr/bin/python3 python3 /usr/bin/python${PYTHON_VERSION} 1
|
| 27 |
-
|
| 28 |
-
# Upgrade pip
|
| 29 |
-
RUN python -m pip install --no-cache-dir --upgrade pip setuptools wheel
|
| 30 |
-
|
| 31 |
-
# Install PyTorch 2.5.1+ FIRST (required for xfuser's torch.distributed.tensor.experimental)
|
| 32 |
-
RUN pip install --no-cache-dir \
|
| 33 |
-
torch==2.5.1 \
|
| 34 |
-
torchvision==0.20.1 \
|
| 35 |
-
torchaudio==2.5.1 \
|
| 36 |
-
--index-url https://download.pytorch.org/whl/cu121
|
| 37 |
-
|
| 38 |
-
# Try to install flash-attn, but don't fail if it doesn't work
|
| 39 |
-
RUN pip install --no-cache-dir flash-attn==2.7.4.post1 --no-build-isolation || \
|
| 40 |
-
echo "Warning: flash-attn installation failed, continuing without it (will use slower attention)"
|
| 41 |
-
|
| 42 |
-
# Set working directory
|
| 43 |
-
WORKDIR /app
|
| 44 |
-
|
| 45 |
-
# Copy requirements.txt first for better caching
|
| 46 |
-
COPY requirements.txt .
|
| 47 |
-
|
| 48 |
-
# Install remaining requirements (skip torch, torchvision, torchaudio, flash-attn as they're already installed)
|
| 49 |
-
RUN pip install --no-cache-dir -r requirements.txt || \
|
| 50 |
-
(echo "Some packages failed to install" && pip install --no-cache-dir -r requirements.txt --ignore-installed)
|
| 51 |
-
|
| 52 |
-
# Copy application files
|
| 53 |
-
COPY . .
|
| 54 |
-
|
| 55 |
-
# Create user directory and set permissions
|
| 56 |
-
RUN useradd -m -u 1000 user && \
|
| 57 |
-
chown -R user:user /app && \
|
| 58 |
-
mkdir -p /home/user/.cache /home/user/.local && \
|
| 59 |
-
chown -R user:user /home/user
|
| 60 |
-
|
| 61 |
-
# Switch to non-root user
|
| 62 |
-
USER user
|
| 63 |
-
|
| 64 |
-
# Set environment for HuggingFace
|
| 65 |
-
ENV HOME=/home/user \
|
| 66 |
-
PATH=/home/user/.local/bin:$PATH \
|
| 67 |
-
PYTHONPATH=/app \
|
| 68 |
-
HF_HOME=/home/user/.cache/huggingface
|
| 69 |
-
|
| 70 |
-
# Expose port for Gradio
|
| 71 |
-
EXPOSE 7860
|
| 72 |
-
|
| 73 |
-
# Run the application
|
| 74 |
-
CMD ["python", "app.py"]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|