-
Notifications
You must be signed in to change notification settings - Fork 5
/
Dockerfile.Standalone
60 lines (52 loc) · 1.58 KB
/
Dockerfile.Standalone
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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
FROM nvidia/cuda:11.8.0-cudnn8-devel-ubuntu22.04
ENV DEBIAN_FRONTEND=noninteractive \
PIP_PREFER_BINARY=1 \
PYTHONUNBUFFERED=1
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
# Upgrade apt packages and install required dependencies
RUN apt update && \
apt upgrade -y && \
apt install -y \
python3-dev \
python3-pip \
python3.10-venv \
fonts-dejavu-core \
rsync \
git \
git-lfs \
jq \
moreutils \
aria2 \
wget \
curl \
libglib2.0-0 \
libsm6 \
libgl1 \
libxrender1 \
libxext6 \
ffmpeg \
libgoogle-perftools-dev \
procps && \
apt-get autoremove -y && \
rm -rf /var/lib/apt/lists/* && \
apt-get clean -y
# Install the worker
WORKDIR /workspace
RUN git clone https://github.com/ashleykleynhans/runpod-worker-llava.git && \
cd runpod-worker-llava && \
pip3 install --no-cache-dir torch==2.0.1 torchvision torchaudio --index-url https://download.pytorch.org/whl/cu118 && \
pip3 install --no-cache-dir xformers==0.0.22 && \
pip3 install -r requirements.txt && \
pip3 install transformers==4.34.1
# Download the model
COPY --chmod=755 download_models.py /download_models.py
ENV HUGGINGFACE_HUB_CACHE="/workspace/huggingface-cache/hub"
ENV TRANSFORMERS_CACHE="/workspace/huggingface-cache/hub"
ENV MODEL="liuhaotian/llava-v1.5-7b"
RUN python3 /download_models.py
# Copy the handler
COPY rp_handler.py /workspace/runpod-worker-llava/rp_handler.py
# Docker container start script
COPY --chmod=755 start_standalone.sh /start.sh
# Start the container
CMD /start.sh