CoolFace
Apppublic

ACE-Step/Ace-Step-v1.5

sourceHugging Facemitupdated 6mo agoView on Hugging Face
580likes
Dockerfile58 linesDownload Raw Back to root
1# HuggingFace Space Docker SDK2# Use slim Python image - HuggingFace GPU Spaces provide CUDA runtime3FROM python:3.11-slim4 5# Set environment variables6ENV PYTHONDONTWRITEBYTECODE=1 \7    PYTHONUNBUFFERED=1 \8    DEBIAN_FRONTEND=noninteractive \9    TORCHAUDIO_USE_TORCHCODEC=010 11# Install system dependencies12# build-essential is required for triton to compile CUDA kernels13# ffmpeg and libav* dev packages are required for torchaudio's ffmpeg backend14# Note: torchaudio's ffmpeg backend needs shared libraries, not just the ffmpeg binary15RUN apt-get update && \16    apt-get install -y --no-install-recommends git libsndfile1 build-essential && \17    apt-get install -y ffmpeg libavcodec-dev libavformat-dev libavutil-dev libswresample-dev && \18    rm -rf /var/lib/apt/lists/*19 20# Set up a new user named "user" with user ID 1000 (HuggingFace Space requirement)21RUN useradd -m -u 1000 user22 23# Create /data directory with proper permissions for persistent storage24RUN mkdir -p /data && chown user:user /data && chmod 755 /data25 26# Set environment variables for user27ENV HOME=/home/user \28    PATH=/home/user/.local/bin:$PATH \29    GRADIO_SERVER_NAME=0.0.0.0 \30    GRADIO_SERVER_PORT=786031 32# Set the working directory33WORKDIR $HOME/app34 35# Copy requirements first for better Docker layer caching36COPY --chown=user:user requirements.txt .37 38# Copy the local nano-vllm package39COPY --chown=user:user acestep/third_parts/nano-vllm ./acestep/third_parts/nano-vllm40 41# Switch to user before installing packages42USER user43 44# Install dependencies from requirements.txt (includes PyTorch with CUDA from --extra-index-url)45RUN pip install --no-cache-dir --user -r requirements.txt46 47# Install nano-vllm with --no-deps since all dependencies are already installed48RUN pip install --no-deps ./acestep/third_parts/nano-vllm49 50# Copy the rest of the application51COPY --chown=user:user . .52 53# Expose port54EXPOSE 786055 56# Run the application57CMD ["python", "app.py"]58