Spaces:
Sleeping
Sleeping
Update Dockerfile
Browse files- Dockerfile +15 -10
Dockerfile
CHANGED
@@ -1,30 +1,35 @@
|
|
1 |
-
#
|
2 |
FROM pytorch/pytorch:1.10.0-cuda11.3-cudnn8-runtime
|
3 |
|
4 |
-
# Install
|
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
|
11 |
-
RUN pip install
|
|
|
|
|
|
|
|
|
|
|
12 |
|
13 |
-
#
|
14 |
RUN mkdir /models
|
15 |
WORKDIR /models
|
16 |
|
17 |
-
# Meta Sapiens Pose
|
18 |
RUN git clone https://huggingface.co/facebook/sapiens-pose-1b-torchscript /models/sapiens_pose
|
19 |
|
20 |
-
# MotionBERT
|
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
|
27 |
EXPOSE 7860
|
28 |
|
29 |
-
# Run the
|
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"]
|