Bring OGA under test and fix OGA server. Improve llm-prompt. #7
Workflow file for this run
This file contains 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
# This workflow will install Python dependencies, run tests and lint with a single version of Python | |
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python | |
name: Lint and Test Lemonade for OGA on CPU | |
on: | |
push: | |
branches: ["main"] | |
pull_request: | |
branches: ["main"] | |
permissions: | |
contents: read | |
jobs: | |
make-oga-cpu-lemonade: | |
env: | |
LEMONADE_CI_MODE: "True" | |
runs-on: windows-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up Miniconda with 64-bit Python | |
uses: conda-incubator/setup-miniconda@v2 | |
with: | |
miniconda-version: "latest" | |
activate-environment: lemon | |
python-version: "3.10" | |
run-post: "false" | |
- name: Install dependencies | |
shell: bash -el {0} | |
run: | | |
python -m pip install --upgrade pip | |
conda install pylint | |
python -m pip check | |
pip install -e .[llm-oga-cpu] | |
- name: Lint with Black | |
uses: psf/black@stable | |
with: | |
options: "--check --verbose" | |
src: "./src" | |
- name: Lint with PyLint | |
shell: bash -el {0} | |
run: | | |
pylint src/lemonade --rcfile .pylintrc --disable E0401 | |
- name: Test OGA+CPU server | |
if: runner.os == 'Windows' | |
timeout-minutes: 10 | |
uses: ./.github/actions/server-testing | |
with: | |
conda_env: -n lemon | |
load_command: -i TinyPixel/small-llama2 oga-load --device cpu --dtype int4 | |
hf_token: "${{ secrets.HUGGINGFACE_ACCESS_TOKEN }}" # Required by OGA model_builder in OGA 0.4.0 but not future versions | |
- name: Run lemonade tests | |
shell: bash -el {0} | |
env: | |
HF_TOKEN: "${{ secrets.HUGGINGFACE_ACCESS_TOKEN }}" # Required by OGA model_builder in OGA 0.4.0 but not future versions | |
run: | | |
lemonade -i TinyPixel/small-llama2 oga-load --device cpu --dtype int4 llm-prompt -p "tell me a story" --max-new-tokens 5 | |
python test/oga_cpu_api.py | |