-
Notifications
You must be signed in to change notification settings - Fork 3
/
Dockerfile.Gpu
39 lines (29 loc) · 1.14 KB
/
Dockerfile.Gpu
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
ARG CUDA_IMAGE="12.1.1-devel-ubuntu22.04"
FROM nvidia/cuda:${CUDA_IMAGE}
RUN curl -sL https://deb.nodesource.com/setup_16.x | bash -
RUN apt-get update && apt-get upgrade -y \
nodejs \
net-tools \
&& apt-get install -y git build-essential \
python3 python3-pip gcc wget \
ocl-icd-opencl-dev opencl-headers clinfo \
libclblast-dev libopenblas-dev \
&& mkdir -p /etc/OpenCL/vendors && echo "libnvidia-opencl.so.1" > /etc/OpenCL/vendors/nvidia.icd
# setting build related env vars
ENV CUDA_DOCKER_ARCH=all
ENV LLAMA_CUBLAS=1
# Install depencencies
RUN python3 -m pip install --upgrade pip pytest cmake scikit-build setuptools fastapi uvicorn sse-starlette pydantic-settings starlette-context
# Install llama-cpp-python (build with cuda)
RUN CMAKE_ARGS="-DLLAMA_CUBLAS=on" pip install llama-cpp-python
RUN pip install llama-cpp-python[server]
COPY requirements_gpu.txt ./
RUN pip3 install -r requirements_gpu.txt
COPY models ./models/
COPY images ./images/
COPY scripts ./scripts/
COPY bot_memories ./bot_memories/
COPY bot_personalities ./bot_personalities/
COPY .env ./
ENV HOST=0.0.0.0
ENTRYPOINT ["python3", "scripts/main.py"]