Spaces:
Sleeping
Sleeping
Update Dockerfile
Browse files- Dockerfile +17 -4
Dockerfile
CHANGED
@@ -1,7 +1,6 @@
|
|
1 |
FROM python:3.10-slim
|
2 |
|
3 |
WORKDIR /app
|
4 |
-
|
5 |
ENV HF_HOME=/tmp/huggingface
|
6 |
ENV TRANSFORMERS_CACHE=/tmp/huggingface/transformers
|
7 |
ENV HF_DATASETS_CACHE=/tmp/huggingface/datasets
|
@@ -11,6 +10,7 @@ ENV MPLCONFIGDIR=/tmp/matplotlib
|
|
11 |
ENV CUDA_VISIBLE_DEVICES=""
|
12 |
ENV HOME=/tmp
|
13 |
|
|
|
14 |
RUN apt-get update && apt-get install -y \
|
15 |
git \
|
16 |
build-essential \
|
@@ -25,12 +25,25 @@ RUN apt-get update && apt-get install -y \
|
|
25 |
libopencv-dev \
|
26 |
&& apt-get clean && rm -rf /var/lib/apt/lists/*
|
27 |
|
28 |
-
|
29 |
RUN pip install --no-cache-dir -U pip && \
|
30 |
-
pip install --no-cache-dir -
|
|
|
|
|
31 |
pip cache purge
|
32 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
33 |
COPY app.py .
|
34 |
|
|
|
35 |
EXPOSE 7860
|
36 |
-
|
|
|
|
|
|
1 |
FROM python:3.10-slim
|
2 |
|
3 |
WORKDIR /app
|
|
|
4 |
ENV HF_HOME=/tmp/huggingface
|
5 |
ENV TRANSFORMERS_CACHE=/tmp/huggingface/transformers
|
6 |
ENV HF_DATASETS_CACHE=/tmp/huggingface/datasets
|
|
|
10 |
ENV CUDA_VISIBLE_DEVICES=""
|
11 |
ENV HOME=/tmp
|
12 |
|
13 |
+
# Install system dependencies
|
14 |
RUN apt-get update && apt-get install -y \
|
15 |
git \
|
16 |
build-essential \
|
|
|
25 |
libopencv-dev \
|
26 |
&& apt-get clean && rm -rf /var/lib/apt/lists/*
|
27 |
|
28 |
+
# Install Point-E and dependencies
|
29 |
RUN pip install --no-cache-dir -U pip && \
|
30 |
+
pip install --no-cache-dir torch==1.13.1 torchvision==0.14.1 --index-url https://download.pytorch.org/whl/cpu && \
|
31 |
+
pip install --no-cache-dir flask flask-cors open3d opencv-python-headless && \
|
32 |
+
pip install --no-cache-dir git+https://github.com/openai/point-e.git && \
|
33 |
pip cache purge
|
34 |
|
35 |
+
# Create a directory for model storage
|
36 |
+
RUN mkdir -p /tmp/point_e_models
|
37 |
+
|
38 |
+
# Copy the pre-trained model weight file if it's available in the build context
|
39 |
+
# Otherwise, users will need to provide this file
|
40 |
+
COPY base40M-textvec.pt /tmp/point_e_models/base40M-textvec.pt
|
41 |
+
|
42 |
+
# Copy application code
|
43 |
COPY app.py .
|
44 |
|
45 |
+
# Expose the port for the Flask server
|
46 |
EXPOSE 7860
|
47 |
+
|
48 |
+
# Command to run the application
|
49 |
+
CMD ["python", "app.py"]
|