mirror of
https://github.com/abetlen/llama-cpp-python.git
synced 2023-09-07 17:34:22 +03:00
Add docker cuda image. Closes #143
This commit is contained in:
34
.github/workflows/build-docker.yaml
vendored
34
.github/workflows/build-docker.yaml
vendored
@@ -36,4 +36,36 @@ jobs:
|
|||||||
push: true # push to registry
|
push: true # push to registry
|
||||||
pull: true # always fetch the latest base images
|
pull: true # always fetch the latest base images
|
||||||
platforms: linux/amd64,linux/arm64 # build for both amd64 and arm64
|
platforms: linux/amd64,linux/arm64 # build for both amd64 and arm64
|
||||||
tags: ghcr.io/abetlen/llama-cpp-python:latest
|
tags: ghcr.io/abetlen/llama-cpp-python:latest
|
||||||
|
|
||||||
|
docker-cuda:
|
||||||
|
name: Build and push Docker image
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v3
|
||||||
|
with:
|
||||||
|
submodules: "true"
|
||||||
|
|
||||||
|
- name: Set up QEMU
|
||||||
|
uses: docker/setup-qemu-action@v2
|
||||||
|
|
||||||
|
- name: Set up Docker Buildx
|
||||||
|
uses: docker/setup-buildx-action@v2
|
||||||
|
|
||||||
|
- name: Login to GitHub Container Registry
|
||||||
|
uses: docker/login-action@v2
|
||||||
|
with:
|
||||||
|
registry: ghcr.io
|
||||||
|
username: ${{ github.repository_owner }}
|
||||||
|
password: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
|
||||||
|
- name: Build and push
|
||||||
|
uses: docker/build-push-action@v4
|
||||||
|
with:
|
||||||
|
file: Dockerfile.cuda
|
||||||
|
context: .
|
||||||
|
push: true # push to registry
|
||||||
|
pull: true # always fetch the latest base images
|
||||||
|
platforms: linux/amd64,linux/arm64 # build for both amd64 and arm64
|
||||||
|
tags: ghcr.io/abetlen/llama-cpp-python-cuda:latest
|
||||||
15
Dockerfile.cuda
Normal file
15
Dockerfile.cuda
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
FROM nvidia/cuda:12.1.1-devel-ubuntu20.04
|
||||||
|
|
||||||
|
# We need to set the host to 0.0.0.0 to allow outside access
|
||||||
|
ENV HOST 0.0.0.0
|
||||||
|
|
||||||
|
COPY . .
|
||||||
|
|
||||||
|
# Install the package
|
||||||
|
RUN apt update && apt install -y python3 python3-pip
|
||||||
|
RUN python3 -m pip install --upgrade pip pytest cmake scikit-build setuptools fastapi uvicorn sse-starlette
|
||||||
|
|
||||||
|
RUN LLAMA_CUBLAS=1 python3 setup.py develop
|
||||||
|
|
||||||
|
# Run the server
|
||||||
|
CMD python3 -m llama_cpp.server
|
||||||
Reference in New Issue
Block a user