Chat support #99
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Release to Maven Central | ||
on: | ||
workflow_dispatch: | ||
inputs: | ||
build_only: | ||
description: 'Whether to only build the project and skip releasing it (yes/NO)' | ||
required: false | ||
default: 'no' | ||
release: | ||
types: [ created ] | ||
env: | ||
MODEL_URL: "https://huggingface.co/TheBloke/CodeLlama-7B-GGUF/resolve/main/codellama-7b.Q2_K.gguf" | ||
MODEL_NAME: "codellama-7b.Q2_K.gguf" | ||
RERANKING_MODEL_URL: "https://huggingface.co/gpustack/jina-reranker-v1-tiny-en-GGUF/resolve/main/jina-reranker-v1-tiny-en-Q4_0.gguf" | ||
RERANKING_MODEL_NAME: "jina-reranker-v1-tiny-en-Q4_0.gguf" | ||
TOOL_CALLING_MODEL_URL: "https://huggingface.co/unsloth/Llama-3.2-3B-Instruct-GGUF/resolve/main/Llama-3.2-3B-Instruct-Q8_0.gguf" | ||
TOOL_CALLING_MODEL_NAME:"Llama-3.2-3B-Instruct-Q8_0.gguf" | ||
jobs: | ||
# todo: doesn't work with the newest llama.cpp version | ||
# build-linux-cuda: | ||
# name: Build Linux x86-64 CUDA12 | ||
# runs-on: ubuntu-latest | ||
# steps: | ||
# - uses: actions/checkout@v4 | ||
# - name: Build libraries | ||
# shell: bash | ||
# run: | | ||
# .github/dockcross/dockcross-manylinux_2_28-x64 .github/build_cuda_linux.sh "-DOS_NAME=Linux -DOS_ARCH=x86_64" | ||
# - name: Upload artifacts | ||
# uses: actions/upload-artifact@v4 | ||
# with: | ||
# name: linux-libraries-cuda | ||
# path: ${{ github.workspace }}/src/main/resources_linux_cuda/de/kherud/llama/ | ||
build-linux-docker: | ||
name: Build ${{ matrix.target.os }}-${{ matrix.target.arch }} | ||
runs-on: ubuntu-latest | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
target: | ||
- { | ||
os: Linux, | ||
arch: x86_64, | ||
image: dockcross-manylinux2014-x64, | ||
} | ||
- { | ||
os: Linux, | ||
arch: aarch64, | ||
image: dockcross-linux-arm64-lts, | ||
} | ||
- { | ||
os: Linux-Android, | ||
arch: aarch64, | ||
image: dockcross-android-arm64, | ||
} | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Build libraries | ||
shell: bash | ||
run: | | ||
.github/dockcross/${{ matrix.target.image }} .github/build.sh "-DOS_NAME=${{ matrix.target.os }} -DOS_ARCH=${{ matrix.target.arch }}" | ||
- name: Upload artifacts | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: ${{ matrix.target.os }}-${{ matrix.target.arch }}-libraries | ||
path: ${{ github.workspace }}/src/main/resources/de/kherud/llama/ | ||
build-macos-native: | ||
name: Build ${{ matrix.target.runner }} | ||
runs-on: ${{ matrix.target.runner }} | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
target: | ||
- { | ||
runner: macos-13, | ||
cmake: '-DLLAMA_METAL=OFF' | ||
} | ||
- { | ||
runner: macos-14, | ||
cmake: '-DLLAMA_METAL_EMBED_LIBRARY=ON' | ||
} | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Build libraries | ||
shell: bash | ||
run: | | ||
mvn compile | ||
.github/build.sh ${{ matrix.target.cmake }} | ||
- name: Upload artifacts | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: ${{ matrix.target.runner }}-libraries | ||
path: ${{ github.workspace }}/src/main/resources/de/kherud/llama/ | ||
build-win-native: | ||
name: Build ${{ matrix.target.os }}-${{ matrix.target.arch }} | ||
runs-on: windows-2019 | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
target: | ||
- { | ||
os: Windows, | ||
arch: x86_64, | ||
cmake: '-G "Visual Studio 16 2019" -A "x64"' | ||
} | ||
- { | ||
os: Windows, | ||
arch: x86, | ||
cmake: '-G "Visual Studio 16 2019" -A "Win32"' | ||
} | ||
# MSVC aarch64 builds no longer work with llama.cpp (requires clang instead) | ||
# - { | ||
# os: Windows, | ||
# arch: aarch64, | ||
# cmake: '-G "Visual Studio 16 2019" -A "ARM64"' | ||
# } | ||
# - { | ||
# os: Windows, | ||
# arch: arm, | ||
# cmake: '-G "Visual Studio 16 2019" -A "ARM"' | ||
# } | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Build libraries | ||
shell: cmd | ||
run: | | ||
.github\build.bat ${{ matrix.target.cmake }} -DOS_NAME=${{ matrix.target.os }} -DOS_ARCH=${{ matrix.target.arch }} | ||
- name: Upload artifacts | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: ${{ matrix.target.os }}-${{ matrix.target.arch }}-libraries | ||
path: ${{ github.workspace }}/src/main/resources/de/kherud/llama/ | ||
test-linux: | ||
name: Test Linux | ||
needs: build-linux-docker | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: actions/download-artifact@v4 | ||
with: | ||
name: Linux-x86_64-libraries | ||
path: ${{ github.workspace }}/src/main/resources/de/kherud/llama/ | ||
- name: Download text generation model | ||
run: curl -L ${MODEL_URL} --create-dirs -o models/${MODEL_NAME} | ||
- name: Download reranking model | ||
run: curl -L ${RERANKING_MODEL_URL} --create-dirs -o models/${RERANKING_MODEL_NAME} | ||
- name: Download tool calling model | ||
run: curl -L ${TOOL_CALLING_MODEL_URL} --create-dirs -o models/${TOOL_CALLING_MODEL_NAME} | ||
- uses: actions/setup-java@v4 | ||
with: | ||
distribution: 'zulu' | ||
java-version: '11' | ||
- name: Run tests | ||
run: mvn test | ||
# test-macos: | ||
# name: Test Mac | ||
# needs: build-macos-native | ||
# runs-on: macos-14 | ||
# steps: | ||
# - uses: actions/checkout@v4 | ||
# - uses: actions/download-artifact@v4 | ||
# with: | ||
# name: macos14-libraries | ||
# path: ${{ github.workspace }}/src/main/resources/de/kherud/llama/ | ||
# - name: Download model | ||
# run: curl -L ${MODEL_URL} --create-dirs -o models/${MODEL_NAME} | ||
# - uses: actions/setup-java@v4 | ||
# with: | ||
# distribution: 'zulu' | ||
# java-version: '11' | ||
# - name: Run tests | ||
# run: mvn test | ||
# test-windows: | ||
# name: Test Windows | ||
# needs: build-win-native | ||
# runs-on: windows-latest | ||
# steps: | ||
# - uses: actions/checkout@v4 | ||
# - uses: actions/download-artifact@v4 | ||
# with: | ||
# name: Windows-x86_64-libraries | ||
# path: ${{ github.workspace }}/src/main/resources/de/kherud/llama/ | ||
# - name: Download model | ||
# run: curl -L $env:MODEL_URL --create-dirs -o models/$env:MODEL_NAME | ||
# - uses: actions/setup-java@v4 | ||
# with: | ||
# distribution: 'zulu' | ||
# java-version: '11' | ||
# - name: Run tests | ||
# run: mvn test | ||
publish: | ||
if: ${{ github.event_name != 'workflow_dispatch' || github.event.inputs.build_only == 'no' }} | ||
needs: [ test-linux,build-macos-native,build-win-native ] #,build-linux-cuda | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: actions/download-artifact@v4 | ||
with: | ||
pattern: "*-libraries" | ||
merge-multiple: true | ||
path: ${{ github.workspace }}/src/main/resources/de/kherud/llama/ | ||
# - uses: actions/download-artifact@v4 | ||
# with: | ||
# name: linux-libraries-cuda | ||
# path: ${{ github.workspace }}/src/main/resources_linux_cuda/de/kherud/llama/ | ||
- name: Set up Maven Central Repository | ||
uses: actions/setup-java@v3 | ||
with: | ||
java-version: '17' | ||
distribution: 'zulu' | ||
server-id: ossrh | ||
server-username: MAVEN_USERNAME | ||
server-password: MAVEN_PASSWORD | ||
gpg-private-key: ${{ secrets.GPG_SIGNING_KEY }} | ||
gpg-passphrase: MAVEN_GPG_PASSPHRASE | ||
- name: Publish package | ||
run: mvn --batch-mode -P release -Dmaven.test.skip=true deploy | ||
env: | ||
MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }} | ||
MAVEN_PASSWORD: ${{ secrets.OSSRH_TOKEN }} | ||
MAVEN_GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }} |