camenduru commited on
Commit
d87723f
1 Parent(s): c2365f3

Create Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +25 -0
Dockerfile ADDED
@@ -0,0 +1,25 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ FROM runpod/pytorch:2.2.1-py3.10-cuda12.1.1-devel-ubuntu22.04
2
+ WORKDIR /content
3
+ ENV PATH="/home/camenduru/.local/bin:${PATH}"
4
+
5
+ RUN adduser --disabled-password --gecos '' camenduru && \
6
+ adduser camenduru sudo && \
7
+ echo '%sudo ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers && \
8
+ chown -R camenduru:camenduru /content && \
9
+ chmod -R 777 /content && \
10
+ chown -R camenduru:camenduru /home && \
11
+ chmod -R 777 /home && \
12
+ apt update -y && add-apt-repository -y ppa:git-core/ppa && apt update -y && apt install -y aria2 git git-lfs unzip ffmpeg
13
+
14
+ USER camenduru
15
+
16
+ RUN pip install -q torch==2.4.0+cu121 torchvision==0.19.0+cu121 torchaudio==2.4.0+cu121 torchtext==0.18.0 torchdata==0.8.0 --extra-index-url https://download.pytorch.org/whl/cu121 \
17
+ transformers==4.44.2 accelerate==0.33.0 bitsandbytes==0.43.3 sentencepiece==0.2.0 protobuf==5.28.0 kornia==0.7.3 timm==1.0.9 runpod && \
18
+ aria2c --console-log-level=error -c -x 16 -s 16 -k 1M https://huggingface.co/camenduru/BiRefNet/raw/main/config.json -d /content/BiRefNet -o config.json && \
19
+ aria2c --console-log-level=error -c -x 16 -s 16 -k 1M https://huggingface.co/camenduru/BiRefNet/resolve/main/model.safetensors -d /content/BiRefNet -o model.safetensors && \
20
+ aria2c --console-log-level=error -c -x 16 -s 16 -k 1M https://huggingface.co/camenduru/BiRefNet/raw/main/BiRefNet_config.py -d /content/BiRefNet -o BiRefNet_config.py && \
21
+ aria2c --console-log-level=error -c -x 16 -s 16 -k 1M https://huggingface.co/camenduru/BiRefNet/raw/main/birefnet.py -d /content/BiRefNet -o birefnet.py
22
+
23
+ COPY ./worker_runpod.py /content/worker_runpod.py
24
+ WORKDIR /content
25
+ CMD python worker_runpod.py