MusicAI-Magnet / Dockerfile
fffiloni's picture
Update Dockerfile
84badbe verified
raw
history blame
1.32 kB
FROM pytorch/pytorch:2.1.0-cuda12.1-cudnn8-runtime
ENV DEBIAN_FRONTEND=noninteractive
# Set the MKL_THREADING_LAYER environment variable to GNU
ENV MKL_THREADING_LAYER=GNU
RUN apt-get update && apt-get install -y git wget libgl1-mesa-glx libglib2.0-0 ffmpeg libx264-dev build-essential cmake aria2
RUN useradd -m -u 1000 user
USER user
ENV HOME=/home/user \
PATH=/home/user/.local/bin:$PATH \
PYTHONPATH=$HOME/app \
PYTHONUNBUFFERED=1 \
GRADIO_ALLOW_FLAGGING=never \
GRADIO_NUM_PORTS=1 \
GRADIO_SERVER_NAME=0.0.0.0 \
GRADIO_THEME=huggingface \
GRADIO_SHARE=False \
SYSTEM=spaces
# Set the working directory to the user's home directory
WORKDIR $HOME/app
RUN git clone -b magnet https://github.com/camenduru/audiocraft $HOME/app
# Install dependencies
RUN pip install -q av julius omegaconf einops num2words flashy torchaudio==2.1.0 --index-url https://download.pytorch.org/whl/cu121 torchmetrics sentencepiece gradio
RUN pip install -q https://github.com/camenduru/wheels/releases/download/colab/xformers-0.0.20+1dc3d7a.d20240115-cp310-cp310-linux_x86_64.whl
RUN pip install -q .
#COPY app.py .
# Set the environment variable to specify the GPU device
ENV CUDA_DEVICE_ORDER=PCI_BUS_ID
ENV CUDA_VISIBLE_DEVICES=0
# Run the Python script
CMD ["python", "-m", "demos.magnet_app", "--share"]