Skip to content

fix model tests

fix model tests #3937

Workflow file for this run

name: Unit Tests
on:
push:
branches:
- 'main'
pull_request:
branches:
- 'main'
workflow_dispatch:
jobs:
linter:
name: Linters
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- name: Checkout Code
uses: actions/checkout@v4
- name: Set up Python 3.9
uses: actions/setup-python@v4
with:
python-version: "3.9"
- name: Install uv
uses: astral-sh/setup-uv@v5
with:
python-version: "latest"
enable-cache: true
- name: Install dependencies and run pre-commit
env:
SKIP: "no-commit-to-branch,mypy"
run: |
uv pip install pre-commit --system
pre-commit run --all-files
testcpu:
name: CPU Tests
runs-on: ubuntu-latest
env:
UV_SYSTEM_PYTHON: 1
strategy:
matrix:
python-version: ["3.9", "3.10", "3.11", "3.12"]
timeout-minutes: 30
steps:
- name: Checkout Code
uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install uv
uses: astral-sh/setup-uv@v5
with:
python-version: ${{ matrix.python-version }}
enable-cache: true
cache-dependency-glob: "**/pyproject.toml"
- name: Install dependencies
run: |
uv pip install -e '.[dev,sentencepiece,api]' --extra-index-url https://download.pytorch.org/whl/cpu --system
- name: Test with pytest
run: uv run pytest --showlocals -s -vv -n=auto --ignore=tests/models/test_neuralmagic.py --ignore=tests/models/test_openvino.py
- name: Archive artifacts
uses: actions/upload-artifact@v4
with:
name: output_testcpu${{ matrix.python-version }}
path: |
test_logs/*
testmodels:
name: External LM Tests
runs-on: ubuntu-latest
timeout-minutes: 30
env:
UV_SYSTEM_PYTHON: 1
steps:
- name: Checkout Code
uses: actions/checkout@v4
- name: Set up Python 3.9
uses: actions/setup-python@v4
with:
python-version: "3.9"
- name: Install uv
uses: astral-sh/setup-uv@v5
with:
python-version: "3.9"
enable-cache: true
cache-dependency-glob: "**/pyproject.toml"
- name: Install dependencies
run: |
uv pip install -e '.[dev,optimum,deepsparse,sparseml,api]' --extra-index-url https://download.pytorch.org/whl/cpu --system
uv pip install -U transformers peft --system
- name: Test with pytest
run: uv run pytest tests/models --showlocals -s -vv