JulianPhillips commited on
Commit
77902b8
·
verified ·
1 Parent(s): 1ea0f2c

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +15 -10
Dockerfile CHANGED
@@ -1,30 +1,35 @@
1
- # Start with an official PyTorch Docker image with CUDA support for GPU acceleration
2
  FROM pytorch/pytorch:1.10.0-cuda11.3-cudnn8-runtime
3
 
4
- # Install essential packages
5
  RUN apt-get update && apt-get install -y \
6
  git \
7
  wget \
8
  && rm -rf /var/lib/apt/lists/*
9
 
10
- # Install Hugging Face Transformers, TorchScript, and additional dependencies
11
- RUN pip install torch torchvision transformers requests
 
 
 
 
 
12
 
13
- # Clone Meta Sapiens Pose model and MotionBERT model from Hugging Face
14
  RUN mkdir /models
15
  WORKDIR /models
16
 
17
- # Meta Sapiens Pose Model
18
  RUN git clone https://huggingface.co/facebook/sapiens-pose-1b-torchscript /models/sapiens_pose
19
 
20
- # MotionBERT Model
21
  RUN git clone https://huggingface.co/walterzhu/MotionBERT /models/motionbert
22
 
23
- # Copy the inference script
24
  COPY app.py /app/app.py
25
 
26
- # Expose port for Flask app
27
  EXPOSE 7860
28
 
29
- # Run the inference script
30
  CMD ["python", "/app/app.py"]
 
1
+ # Base image with PyTorch and CUDA for GPU support
2
  FROM pytorch/pytorch:1.10.0-cuda11.3-cudnn8-runtime
3
 
4
+ # Install system dependencies
5
  RUN apt-get update && apt-get install -y \
6
  git \
7
  wget \
8
  && rm -rf /var/lib/apt/lists/*
9
 
10
+ # Install Python packages including Hugging Face Transformers, TorchScript, and Flask
11
+ RUN pip install --no-cache-dir \
12
+ torch \
13
+ torchvision \
14
+ transformers \
15
+ requests \
16
+ Flask # Explicitly add Flask here
17
 
18
+ # Create a working directory for model files
19
  RUN mkdir /models
20
  WORKDIR /models
21
 
22
+ # Download Meta Sapiens Pose model from Hugging Face Hub
23
  RUN git clone https://huggingface.co/facebook/sapiens-pose-1b-torchscript /models/sapiens_pose
24
 
25
+ # Download MotionBERT model from Hugging Face Hub
26
  RUN git clone https://huggingface.co/walterzhu/MotionBERT /models/motionbert
27
 
28
+ # Copy the inference script (app.py) into the container
29
  COPY app.py /app/app.py
30
 
31
+ # Expose the default port for Flask
32
  EXPOSE 7860
33
 
34
+ # Run the Flask app
35
  CMD ["python", "/app/app.py"]