diff --git a/.github/workflows/build-publish.yaml b/.github/workflows/build-publish.yaml index 8632b92..e755415 100644 --- a/.github/workflows/build-publish.yaml +++ b/.github/workflows/build-publish.yaml @@ -53,6 +53,13 @@ jobs: sudo apt-get update sudo apt-get install -y qemu-user-static + - name: Clone llama-cpp-python + run: | + git config --global user.email "podman-deskop@redhat.com" + git config --global user.name "Podman Desktop team" + cd chat + ./setup.sh + - name: Build Playground Image id: build-image uses: redhat-actions/buildah-build@v2 diff --git a/.github/workflows/pr-check.yaml b/.github/workflows/pr-check.yaml index e990f45..1e658f2 100644 --- a/.github/workflows/pr-check.yaml +++ b/.github/workflows/pr-check.yaml @@ -49,6 +49,13 @@ jobs: sudo apt-get update sudo apt-get install -y qemu-user-static + - name: Clone llama-cpp-python + run: | + git config --global user.email "podman-deskop@redhat.com" + git config --global user.name "Podman Desktop team" + cd chat + ./setup.sh + - name: Build Playground Image id: build-image uses: redhat-actions/buildah-build@v2 diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 2f8d840..d4177a5 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -89,6 +89,13 @@ jobs: sudo apt-get update sudo apt-get install -y qemu-user-static + - name: Clone llama-cpp-python + run: | + git config --global user.email "podman-deskop@redhat.com" + git config --global user.name "Podman Desktop team" + cd chat + ./setup.sh + - name: Build Playground Image id: build-image uses: redhat-actions/buildah-build@v2 @@ -130,4 +137,4 @@ jobs: with: tag: ${{ needs.tag.outputs.githubTag }} name: ${{ needs.tag.outputs.githubTag }} - \ No newline at end of file + diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..8a64383 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +llama-cpp-python diff --git a/chat/base/Containerfile b/chat/base/Containerfile index 23efe9c..a2c59c9 100644 --- a/chat/base/Containerfile +++ b/chat/base/Containerfile @@ -21,6 +21,7 @@ RUN microdnf install -y python3 python3-pip gcc g++ shadow-utils && microdnf cle RUN useradd -r -g root -m -d /home/default -s /bin/bash default WORKDIR /home/default COPY requirements.txt requirements.txt +COPY llama-cpp-python llama-cpp-python RUN pip install --no-cache-dir --upgrade -r requirements.txt USER default COPY run.sh run.sh diff --git a/chat/cuda/amd64/Containerfile b/chat/cuda/amd64/Containerfile index 86d94c3..bf14595 100644 --- a/chat/cuda/amd64/Containerfile +++ b/chat/cuda/amd64/Containerfile @@ -20,6 +20,7 @@ RUN dnf install -y gcc-toolset-13-gcc gcc-toolset-13-gcc-c++ USER 1001 WORKDIR /locallm COPY requirements.txt . +COPY --chown=1001 llama-cpp-python llama-cpp-python COPY run.sh . ENV CMAKE_ARGS="-DGGML_CUDA=on -DLLAMA_AVX2=OFF -DLLAMA_FMA=OFF -DLLAMA_F16C=OFF" ENV FORCE_CMAKE=1 diff --git a/chat/requirements.txt b/chat/requirements.txt index 8bee099..dc6afb3 100644 --- a/chat/requirements.txt +++ b/chat/requirements.txt @@ -1,2 +1,2 @@ -llama-cpp-python[server]==0.3.2 +./llama-cpp-python[server] pip==24.3.1 diff --git a/chat/setup.sh b/chat/setup.sh new file mode 100755 index 0000000..19cdb12 --- /dev/null +++ b/chat/setup.sh @@ -0,0 +1,6 @@ +git clone https://github.com/abetlen/llama-cpp-python --no-checkout --recurse-submodules +cd llama-cpp-python +git checkout v0.3.2 +git submodule update +git fetch origin pull/1552/head +git rebase ffc47e5a95cf31fe6d9d6d7953d5eb17fdcc8513 diff --git a/chat/vulkan/amd64/Containerfile b/chat/vulkan/amd64/Containerfile index b57d8d6..c4ffdad 100644 --- a/chat/vulkan/amd64/Containerfile +++ b/chat/vulkan/amd64/Containerfile @@ -32,6 +32,7 @@ RUN dnf install -y python3-dnf-plugin-versionlock && \ WORKDIR /locallm COPY requirements.txt ./ +COPY llama-cpp-python llama-cpp-python RUN pip install --upgrade pip ENV CMAKE_ARGS="-DGGML_VULKAN=on" ENV FORCE_CMAKE=1 diff --git a/chat/vulkan/arm64/Containerfile b/chat/vulkan/arm64/Containerfile index 7198c5e..4351c3a 100644 --- a/chat/vulkan/arm64/Containerfile +++ b/chat/vulkan/arm64/Containerfile @@ -30,6 +30,7 @@ https://dl.fedoraproject.org/pub/epel/epel-release-latest-9.noarch.rpm && \ dnf install -y glslc && \ dnf clean all COPY requirements.txt ./ +COPY llama-cpp-python llama-cpp-python RUN pip install --upgrade pip ENV CMAKE_ARGS="-DGGML_VULKAN=on" ENV FORCE_CMAKE=1