File size: 1,517 Bytes
73ed896
 
 
 
 
 
9ea24c7
 
73ed896
 
 
 
 
c5cb92f
73ed896
 
9ea24c7
 
 
 
 
 
 
 
73ed896
f47eaa6
 
73ed896
c5cb92f
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
9ea24c7
73ed896
 
 
c5cb92f
 
9b08090
73ed896
 
 
 
9ea24c7
73ed896
f47eaa6
73ed896
 
9b08090
 
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
58
59
60
61
62
63
64
65
66
FROM nvidia/cuda:11.8.0-runtime-ubuntu22.04

WORKDIR /code

# Install system dependencies
RUN apt-get update && apt-get install -y \
    python3.10 \
    python3.10-distutils \
    python3-pip \
    git \
    ffmpeg \
    libsm6 \
    libxext6 \
    curl \
    && rm -rf /var/lib/apt/lists/*

# Ensure we're using Python 3.10
RUN update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.10 1

# Install pip for Python 3.10
RUN curl -sS https://bootstrap.pypa.io/get-pip.py | python3.10

# Clone MMAudio
RUN git clone https://github.com/hkchengrex/MMAudio.git

# Set working directory to MMAudio
WORKDIR /code/MMAudio

# Install base dependencies first
RUN pip3 install --no-cache-dir \
    setuptools \
    wheel \
    numpy==1.24.3 \
    colorlog \
    typing_extensions

# Install PyTorch and related packages
RUN pip3 install --no-cache-dir \
    torch==2.1.2 \
    torchvision==0.16.2 \
    torchaudio==2.1.2 \
    --index-url https://download.pytorch.org/whl/cu118

# Install other dependencies
RUN pip3 install --no-cache-dir -r requirements.txt

# Install MMAudio
RUN pip3 install -e .

# Create output directory
RUN mkdir -p output/gradio && chmod 777 output/gradio

# Copy app.py (we'll use our own version instead of the one from the repo)
COPY app.py .

# Set environment variables for Hugging Face Spaces
ENV PYTHONUNBUFFERED=1
ENV GRADIO_SERVER_NAME=0.0.0.0
ENV GRADIO_SERVER_PORT=7860
ENV PYTHONPATH=/code/MMAudio

# Expose Gradio port
EXPOSE 7860

# Run the app
CMD ["python3", "app.py"]