Spaces:
Running
on
Zero
Running
on
Zero
Commit
·
e462db8
1
Parent(s):
4c98d1f
update
Browse files- Dockerfile +34 -6
Dockerfile
CHANGED
|
@@ -1,6 +1,15 @@
|
|
| 1 |
-
FROM
|
| 2 |
|
| 3 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 4 |
|
| 5 |
# Choose a writable directory, e.g., /home/user/huggingface
|
| 6 |
RUN mkdir -p /home/user/huggingface
|
|
@@ -11,9 +20,28 @@ ENV HF_HOME=/home/user/huggingface \
|
|
| 11 |
HF_HUB_CACHE=/home/user/huggingface/hub \
|
| 12 |
TRANSFORMERS_CACHE=/home/user/huggingface/hub
|
| 13 |
|
| 14 |
-
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
|
| 18 |
COPY . .
|
| 19 |
CMD ["python", "app.py"]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
FROM nvidia/cuda:11.8.0-cudnn8-devel-ubuntu22.04
|
| 2 |
|
| 3 |
+
RUN apt-get update && apt-get install -y \
|
| 4 |
+
python3 python3-pip python3-dev cmake build-essential \
|
| 5 |
+
libboost-all-dev libopenblas-dev liblapack-dev
|
| 6 |
+
|
| 7 |
+
RUN git clone https://github.com/davisking/dlib.git /dlib \
|
| 8 |
+
&& cd /dlib \
|
| 9 |
+
&& mkdir build && cd build \
|
| 10 |
+
&& cmake .. -DDLIB_USE_CUDA=1 \
|
| 11 |
+
&& cmake --build . --config Release \
|
| 12 |
+
&& python3 setup.py install
|
| 13 |
|
| 14 |
# Choose a writable directory, e.g., /home/user/huggingface
|
| 15 |
RUN mkdir -p /home/user/huggingface
|
|
|
|
| 20 |
HF_HUB_CACHE=/home/user/huggingface/hub \
|
| 21 |
TRANSFORMERS_CACHE=/home/user/huggingface/hub
|
| 22 |
|
| 23 |
+
WORKDIR /app
|
| 24 |
+
COPY requirements.txt ./
|
| 25 |
+
RUN pip install --upgrade pip && pip install -r requirements.txt
|
|
|
|
| 26 |
COPY . .
|
| 27 |
CMD ["python", "app.py"]
|
| 28 |
+
|
| 29 |
+
# FROM yogi0421/dlib-base-image:python38-dlib19.24.0
|
| 30 |
+
|
| 31 |
+
# WORKDIR /app
|
| 32 |
+
|
| 33 |
+
# # Choose a writable directory, e.g., /home/user/huggingface
|
| 34 |
+
# RUN mkdir -p /home/user/huggingface
|
| 35 |
+
# RUN chmod -R 777 /home/user/huggingface
|
| 36 |
+
|
| 37 |
+
# # Then set environment variables
|
| 38 |
+
# ENV HF_HOME=/home/user/huggingface \
|
| 39 |
+
# HF_HUB_CACHE=/home/user/huggingface/hub \
|
| 40 |
+
# TRANSFORMERS_CACHE=/home/user/huggingface/hub
|
| 41 |
+
|
| 42 |
+
# COPY requirements.txt .
|
| 43 |
+
# RUN pip install --upgrade pip \
|
| 44 |
+
# && pip install -r requirements.txt
|
| 45 |
+
|
| 46 |
+
# COPY . .
|
| 47 |
+
# CMD ["python", "app.py"]
|