Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

skip openvivo test #2603

Closed
wants to merge 9 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/unit_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ jobs:
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -U transformers
pip install -e '.[dev,optimum,deepsparse,sparseml,api]' --extra-index-url https://download.pytorch.org/whl/cpu
- name: Test with pytest
run: python -m pytest tests/models --showlocals -s -vv
13 changes: 13 additions & 0 deletions tests/models/conftest.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# # ruff: noqa
# from pathlib import Path
#
# def pytest_ignore_collect(collection_path: Path, config):
# """Return True to prevent pytest from collecting problematic model tests"""
# try:
# from transformers import EncoderDecoderCache
# return False # Allow collection if import succeeds
# except ImportError as e:
# # Only ignore files in the models directory
# if "models/test_" in str(collection_path):
# return True # Skip collection
# return False # Collect all other tests
8 changes: 7 additions & 1 deletion tests/models/test_openvino.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
# ruff: noqa
import random
import tempfile
from pathlib import Path

import pytest
from optimum.intel import OVModelForCausalLM
from transformers import AutoTokenizer

from lm_eval import evaluator
Expand All @@ -16,8 +16,11 @@
}


@pytest.mark.skip("Test failing due to PEFT import error")
@pytest.mark.parametrize("model_id,task", SUPPORTED_ARCHITECTURES_TASKS.items())
def test_evaluator(model_id, task):
from optimum.intel import OVModelForCausalLM

with tempfile.TemporaryDirectory() as tmpdirname:
model = OVModelForCausalLM.from_pretrained(
model_id, export=True, use_cache=True
Expand Down Expand Up @@ -74,7 +77,10 @@ def ll_perp_fn(reqs):
)


@pytest.mark.skip("Test failing due to PEFT import error")
def test_ov_config():
from optimum.intel import OVModelForCausalLM

"""Test that if specified, a custom OpenVINO config is loaded correctly"""
model_id = "hf-internal-testing/tiny-random-gpt2"
with tempfile.TemporaryDirectory() as tmpdirname:
Expand Down
Loading