Update sampling API for llama.cpp #2714
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: Tests | |
on: | |
pull_request: | |
branches: | |
- main | |
push: | |
branches: | |
- main | |
env: | |
REPO_ID: Qwen/Qwen2-0.5B-Instruct-GGUF | |
MODEL_FILE: qwen2-0_5b-instruct-q8_0.gguf | |
jobs: | |
download-model: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Set up Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: "3.9" | |
- name: Install huggingface-hub | |
run: pip install huggingface-hub | |
- name: Download model | |
run: huggingface-hub download ${{ env.REPO_ID }} ${{ env.MODEL_FILE }} | |
- name: Cache model | |
uses: actions/cache@v3 | |
with: | |
path: ~/.cache/huggingface/hub | |
key: ${{ runner.os }}-model-${{ env.REPO_ID }}-${{ env.MODEL_FILE }} | |
build-linux: | |
needs: download-model | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
python-version: ["3.9", "3.10", "3.11", "3.12"] | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
submodules: "recursive" | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ matrix.python-version }} | |
cache: 'pip' | |
- name: Restore model cache | |
uses: actions/cache@v3 | |
with: | |
path: ~/.cache/huggingface/hub | |
key: ${{ runner.os }}-model-${{ env.REPO_ID }}-${{ env.MODEL_FILE }} | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
python -m pip install .[all] -v | |
- name: Test with pytest | |
run: | | |
python -m pytest | |
build-windows: | |
needs: download-model | |
runs-on: windows-latest | |
strategy: | |
matrix: | |
python-version: ["3.9", "3.10", "3.11", "3.12"] | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
submodules: "recursive" | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ matrix.python-version }} | |
cache: 'pip' | |
- name: Restore model cache | |
uses: actions/cache@v3 | |
with: | |
path: ~/.cache/huggingface/hub | |
key: ${{ runner.os }}-model-${{ env.REPO_ID }}-${{ env.MODEL_FILE }} | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
python -m pip install .[all] -v | |
- name: Test with pytest | |
run: | | |
python -m pytest | |
build-macos: | |
needs: download-model | |
runs-on: macos-latest | |
strategy: | |
matrix: | |
python-version: ["3.9", "3.10", "3.11", "3.12"] | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
submodules: "recursive" | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ matrix.python-version }} | |
cache: 'pip' | |
- name: Restore model cache | |
uses: actions/cache@v3 | |
with: | |
path: ~/.cache/huggingface/hub | |
key: ${{ runner.os }}-model-${{ env.REPO_ID }}-${{ env.MODEL_FILE }} | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
python -m pip install .[all] --verbose | |
- name: Test with pytest | |
run: | | |
python -m pytest | |
build-macos-metal: | |
needs: download-model | |
runs-on: macos-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
submodules: "recursive" | |
- name: Set up Python 3.9 | |
uses: actions/setup-python@v5 | |
with: | |
python-version: "3.9" | |
- name: Restore model cache | |
uses: actions/cache@v3 | |
with: | |
path: ~/.cache/huggingface/hub | |
key: ${{ runner.os }}-model-${{ env.REPO_ID }}-${{ env.MODEL_FILE }} | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
CMAKE_ARGS="-DGGML_METAL=on" python -m pip install .[all] --verbose | |
- name: Test with pytest | |
run: | | |
python -m pytest |