Spaces:
Sleeping
Sleeping
Update Dockerfile
Browse files- Dockerfile +2 -11
Dockerfile
CHANGED
@@ -5,7 +5,6 @@ WORKDIR /app
|
|
5 |
ENV HF_HOME=/tmp/huggingface
|
6 |
ENV TRANSFORMERS_CACHE=/tmp/huggingface/transformers
|
7 |
ENV HF_DATASETS_CACHE=/tmp/huggingface/datasets
|
8 |
-
ENV NUMBA_CACHE_DIR=/tmp/numba_cache
|
9 |
ENV HOME=/tmp
|
10 |
ENV PYTHONDONTWRITEBYTECODE=1
|
11 |
ENV PYTHONUNBUFFERED=1
|
@@ -23,19 +22,11 @@ RUN apt-get update && apt-get install -y \
|
|
23 |
libopenblas-dev \
|
24 |
liblapack-dev \
|
25 |
libopencv-dev \
|
26 |
-
libomp-dev \
|
27 |
&& apt-get clean \
|
28 |
&& rm -rf /var/lib/apt/lists/*
|
29 |
|
30 |
-
RUN mkdir -p /tmp/uploads /tmp/results /tmp/huggingface/transformers /tmp/huggingface/datasets /tmp
|
31 |
-
&& chmod -R 777 /tmp/uploads /tmp/results /tmp/huggingface /tmp
|
32 |
-
|
33 |
-
# Install huggingface_hub early to download u2net.pth
|
34 |
-
RUN pip install --no-cache-dir huggingface_hub==0.23.0
|
35 |
-
|
36 |
-
# Download u2net.pth using hf_hub_download with HF_TOKEN
|
37 |
-
RUN python -c "from huggingface_hub import hf_hub_download; hf_hub_download(repo_id='nadermx/backgroundremover', filename='u2net.pth', local_dir='/tmp/.u2net', token='${HF_TOKEN}')" \
|
38 |
-
&& chmod 644 /tmp/.u2net/u2net.pth
|
39 |
|
40 |
# Copy requirements file and install dependencies
|
41 |
COPY requirements.txt .
|
|
|
5 |
ENV HF_HOME=/tmp/huggingface
|
6 |
ENV TRANSFORMERS_CACHE=/tmp/huggingface/transformers
|
7 |
ENV HF_DATASETS_CACHE=/tmp/huggingface/datasets
|
|
|
8 |
ENV HOME=/tmp
|
9 |
ENV PYTHONDONTWRITEBYTECODE=1
|
10 |
ENV PYTHONUNBUFFERED=1
|
|
|
22 |
libopenblas-dev \
|
23 |
liblapack-dev \
|
24 |
libopencv-dev \
|
|
|
25 |
&& apt-get clean \
|
26 |
&& rm -rf /var/lib/apt/lists/*
|
27 |
|
28 |
+
RUN mkdir -p /tmp/uploads /tmp/results /tmp/huggingface/transformers /tmp/huggingface/datasets /tmp/.u2net \
|
29 |
+
&& chmod -R 777 /tmp/uploads /tmp/results /tmp/huggingface /tmp/.u2net
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
30 |
|
31 |
# Copy requirements file and install dependencies
|
32 |
COPY requirements.txt .
|