Spaces:
Paused
Paused
# Use PyTorch 2.1.0 with CUDA 11.8 (devel version) | |
FROM pytorch/pytorch:2.1.0-cuda11.8-cudnn8-devel | |
ENV DEBIAN_FRONTEND=noninteractive | |
# Install prerequisites and add PPA for Python 3.11 | |
RUN apt-get update && apt-get install -y software-properties-common && \ | |
add-apt-repository -y ppa:deadsnakes/ppa && \ | |
apt-get update && apt-get install -y \ | |
python3.11 python3.11-dev python3.11-venv python3.11-distutils python3-pip && \ | |
update-alternatives --install /usr/bin/python python /usr/bin/python3.11 1 && \ | |
update-alternatives --install /usr/bin/pip pip /usr/bin/pip3 1 | |
# Verify Python version | |
RUN python --version | |
# Install a compatible dlib wheel | |
RUN pip install --no-cache-dir \ | |
dlib | |
# Set up user | |
RUN useradd -m -u 1000 user | |
USER user | |
# Set environment variables | |
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 working directory | |
WORKDIR $HOME/app | |
# Clone the app repo | |
RUN git clone -b dev https://github.com/fffiloni/dreamtalk $HOME/app | |
# Download model checkpoints | |
RUN wget https://huggingface.co/camenduru/dreamtalk/resolve/main/damo/dreamtalk/checkpoints/denoising_network.pth -O $HOME/app/checkpoints/denoising_network.pth | |
RUN wget https://huggingface.co/camenduru/dreamtalk/resolve/main/damo/dreamtalk/checkpoints/renderer.pt -O $HOME/app/checkpoints/renderer.pt | |
# Install other dependencies | |
RUN pip install --no-cache-dir \ | |
urllib3 transformers yacs scipy scikit-image scikit-learn \ | |
PyYAML Pillow numpy opencv-python imageio ffmpeg-python av gradio "moviepy<2" | |
# Copy app script | |
COPY app.py . | |
# Set CUDA environment variables | |
ENV CUDA_DEVICE_ORDER=PCI_BUS_ID | |
ENV CUDA_VISIBLE_DEVICES=0 | |
# Run the app | |
CMD ["python", "app.py"] | |