fffiloni commited on
Commit
6f69003
·
verified ·
1 Parent(s): 904b8b0

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +31 -22
Dockerfile CHANGED
@@ -1,44 +1,53 @@
1
- FROM pytorch/pytorch:2.0.1-cuda11.7-cudnn8-runtime
 
2
 
3
  ENV DEBIAN_FRONTEND=noninteractive
4
 
5
- # Set the MKL_THREADING_LAYER environment variable to GNU
6
- ENV MKL_THREADING_LAYER=GNU
 
 
7
 
8
- RUN apt-get update && apt-get install -y git wget libgl1-mesa-glx libglib2.0-0 ffmpeg libx264-dev build-essential libboost-all-dev
 
9
 
 
10
  RUN useradd -m -u 1000 user
11
-
12
  USER user
13
 
 
14
  ENV HOME=/home/user \
15
- PATH=/home/user/.local/bin:$PATH \
16
  PYTHONPATH=$HOME/app \
17
- PYTHONUNBUFFERED=1 \
18
- GRADIO_ALLOW_FLAGGING=never \
19
- GRADIO_NUM_PORTS=1 \
20
- GRADIO_SERVER_NAME=0.0.0.0 \
21
- GRADIO_THEME=huggingface \
22
  GRADIO_SHARE=False \
23
- SYSTEM=spaces
24
 
25
- # Set the working directory to the user's home directory
26
  WORKDIR $HOME/app
27
 
28
- RUN git clone -b dev https://github.com/fffiloni/dreamtalk $HOME/app
29
-
 
 
30
  RUN wget https://huggingface.co/camenduru/dreamtalk/resolve/main/damo/dreamtalk/checkpoints/denoising_network.pth -O $HOME/app/checkpoints/denoising_network.pth
31
  RUN wget https://huggingface.co/camenduru/dreamtalk/resolve/main/damo/dreamtalk/checkpoints/renderer.pt -O $HOME/app/checkpoints/renderer.pt
32
-
33
- # Install dependencies
34
- RUN pip install --no-cache-dir cmake dlib
35
- RUN pip install --no-cache-dir urllib3 transformers yacs scipy scikit-image scikit-learn PyYAML Pillow "numpy<2" opencv-python imageio ffmpeg-python av gradio "moviepy<2.0"
36
 
 
 
 
 
 
 
37
  COPY app.py .
38
 
39
- # Set the environment variable to specify the GPU device
40
  ENV CUDA_DEVICE_ORDER=PCI_BUS_ID
41
  ENV CUDA_VISIBLE_DEVICES=0
42
 
43
- # Run your app.py script
44
- CMD ["python", "app.py"]
 
1
+ # Use a newer PyTorch image with Python 3.11
2
+ FROM pytorch/pytorch:2.1.0-cuda11.8-cudnn8-runtime
3
 
4
  ENV DEBIAN_FRONTEND=noninteractive
5
 
6
+ # Install system dependencies
7
+ RUN apt-get update && apt-get install -y \
8
+ git wget libgl1-mesa-glx libglib2.0-0 ffmpeg libx264-dev build-essential cmake \
9
+ libboost-all-dev python3-dev
10
 
11
+ # Install dlib via pip (Python 3.11 should be available now)
12
+ RUN pip install --no-cache-dir dlib
13
 
14
+ # Set up user
15
  RUN useradd -m -u 1000 user
 
16
  USER user
17
 
18
+ # Set environment variables
19
  ENV HOME=/home/user \
20
+ PATH=/home/user/.local/bin:$PATH \
21
  PYTHONPATH=$HOME/app \
22
+ PYTHONUNBUFFERED=1 \
23
+ GRADIO_ALLOW_FLAGGING=never \
24
+ GRADIO_NUM_PORTS=1 \
25
+ GRADIO_SERVER_NAME=0.0.0.0 \
26
+ GRADIO_THEME=huggingface \
27
  GRADIO_SHARE=False \
28
+ SYSTEM=spaces
29
 
30
+ # Set working directory
31
  WORKDIR $HOME/app
32
 
33
+ # Clone the app repo
34
+ RUN git clone -b dev https://github.com/fffiloni/dreamtalk $HOME/app
35
+
36
+ # Download model checkpoints
37
  RUN wget https://huggingface.co/camenduru/dreamtalk/resolve/main/damo/dreamtalk/checkpoints/denoising_network.pth -O $HOME/app/checkpoints/denoising_network.pth
38
  RUN wget https://huggingface.co/camenduru/dreamtalk/resolve/main/damo/dreamtalk/checkpoints/renderer.pt -O $HOME/app/checkpoints/renderer.pt
 
 
 
 
39
 
40
+ # Install other dependencies
41
+ RUN pip install --no-cache-dir \
42
+ urllib3 transformers yacs scipy scikit-image scikit-learn \
43
+ PyYAML Pillow numpy opencv-python imageio ffmpeg-python av gradio "moviepy<2"
44
+
45
+ # Copy app script
46
  COPY app.py .
47
 
48
+ # Set CUDA environment variables
49
  ENV CUDA_DEVICE_ORDER=PCI_BUS_ID
50
  ENV CUDA_VISIBLE_DEVICES=0
51
 
52
+ # Run the app
53
+ CMD ["python", "app.py"]