|
ARG CUDA_IMAGE="12.1.1-devel-ubuntu22.04" |
|
FROM nvidia/cuda:${CUDA_IMAGE} |
|
|
|
|
|
ENV HOST 0.0.0.0 |
|
|
|
RUN apt-get update && apt-get upgrade -y \ |
|
&& 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 |
|
|
|
COPY . . |
|
|
|
|
|
ENV CUDA_DOCKER_ARCH=all |
|
ENV LLAMA_CUBLAS=1 |
|
|
|
|
|
RUN python3 -m pip install --upgrade pip pytest cmake scikit-build setuptools fastapi uvicorn sse-starlette pydantic-settings starlette-context huggingface-hub==0.14.1 flask |
|
|
|
|
|
RUN CMAKE_ARGS="-DLLAMA_CUBLAS=on" pip install llama-cpp-python |
|
|
|
|
|
CMD python3 -m app.py |