forked from runpod-workers/worker-infinity-embedding
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
33 lines (22 loc) · 1013 Bytes
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
ARG WORKER_CUDA_VERSION=12.1.0
FROM runpod/base:0.6.2-cuda${WORKER_CUDA_VERSION}
#Reinitialize, as its lost after the FROM command
ARG WORKER_CUDA_VERSION=12.1.0
# Define the argument for the Hugging Face token
ARG JOORI_EMBEDDING_HUGGINGFACE_TOKEN
# Python dependencies
COPY builder/requirements.txt /requirements.txt
COPY src/download.py /download.py
# Install Python dependencies
RUN python3.11 -m pip install --upgrade pip
RUN python3.11 -m pip install --no-cache-dir -r requirements.txt
RUN python3.11 -m pip install --no-cache-dir flash-attn --no-build-isolation
# Download the model
RUN python3.11 download.py $JOORI_EMBEDDING_HUGGINGFACE_TOKEN
RUN pip uninstall torch -y && \
CUDA_VERSION_SHORT=$(echo ${WORKER_CUDA_VERSION} | cut -d. -f1,2 | tr -d .) && \
pip install --pre torch torchvision --index-url https://download.pytorch.org/whl/nightly/cu${CUDA_VERSION_SHORT} --no-cache-dir
ENV HF_HOME=/runpod-volume
# Add src files (Worker Template)
ADD src .
CMD python3.11 -u /handler.py