Skip to content

Commit e7610aa

Browse files
committed
Schedule nightly slow tests
1 parent c290c55 commit e7610aa

File tree

2 files changed

+18
-2
lines changed

2 files changed

+18
-2
lines changed

.github/workflows/test_openvino_basic.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ jobs:
2525
# Testing lower and upper bound of supported Python versions
2626
# This also ensures that the test fails if dependencies break for Python 3.7
2727
python-version: ["3.8", "3.11"]
28-
transformers: ['transformers', 'git+https://github.com/huggingface/transformers.git']
28+
transformers: ['transformers']
2929
optimum: ['optimum', 'git+https://github.com/huggingface/optimum.git']
3030

3131
runs-on: ubuntu-20.04
@@ -51,4 +51,4 @@ jobs:
5151
- name: Test with Pytest
5252
run: |
5353
pytest tests/openvino/test_modeling_basic.py
54-
54+
RUN_SLOW=1 pytest tests/openvino/test_modeling.py -s -m "run_slow" --durations=0

tests/openvino/test_modeling.py

+16
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
from typing import Dict
2121

2222
import numpy as np
23+
import pytest
2324
import requests
2425
import timm
2526
import torch
@@ -53,6 +54,7 @@
5354
set_seed,
5455
)
5556
from transformers.onnx.utils import get_preprocessor
57+
from transformers.testing_utils import slow
5658
from utils_tests import MODEL_NAMES
5759

5860
from optimum.intel import (
@@ -364,6 +366,8 @@ def test_compare_to_transformers(self, model_arch):
364366
gc.collect()
365367

366368
@parameterized.expand(SUPPORTED_ARCHITECTURES)
369+
@pytest.mark.run_slow
370+
@slow
367371
def test_pipeline(self, model_arch):
368372
model_id = MODEL_NAMES[model_arch]
369373
model = OVModelForQuestionAnswering.from_pretrained(model_id, export=True)
@@ -379,6 +383,8 @@ def test_pipeline(self, model_arch):
379383
del model
380384
gc.collect()
381385

386+
@pytest.mark.run_slow
387+
@slow
382388
def test_metric(self):
383389
model_id = "distilbert-base-cased-distilled-squad"
384390
set_seed(SEED)
@@ -431,6 +437,8 @@ def test_compare_to_transformers(self, model_arch):
431437
gc.collect()
432438

433439
@parameterized.expand(SUPPORTED_ARCHITECTURES)
440+
@pytest.mark.run_slow
441+
@slow
434442
def test_pipeline(self, model_arch):
435443
model_id = MODEL_NAMES[model_arch]
436444
model = OVModelForTokenClassification.from_pretrained(model_id, export=True)
@@ -481,6 +489,8 @@ def test_compare_to_transformers(self, model_arch):
481489
gc.collect()
482490

483491
@parameterized.expand(SUPPORTED_ARCHITECTURES)
492+
@pytest.mark.run_slow
493+
@slow
484494
def test_pipeline(self, model_arch):
485495
model_id = MODEL_NAMES[model_arch]
486496
model = OVModelForFeatureExtraction.from_pretrained(model_id, export=True)
@@ -851,6 +861,8 @@ def test_compare_to_transformers(self, model_arch):
851861
gc.collect()
852862

853863
@parameterized.expand(SUPPORTED_ARCHITECTURES)
864+
@pytest.mark.run_slow
865+
@slow
854866
def test_pipeline(self, model_arch):
855867
model_id = MODEL_NAMES[model_arch]
856868
model = OVModelForImageClassification.from_pretrained(model_id, export=True)
@@ -981,6 +993,8 @@ def test_pipeline(self, model_arch):
981993
gc.collect()
982994

983995
@parameterized.expand(SUPPORTED_ARCHITECTURES)
996+
@pytest.mark.run_slow
997+
@slow
984998
def test_generate_utils(self, model_arch):
985999
model_id = MODEL_NAMES[model_arch]
9861000
model = OVModelForSeq2SeqLM.from_pretrained(model_id, export=True)
@@ -1438,6 +1452,8 @@ def test_load_vanilla_transformers_which_is_not_supported(self):
14381452
self.assertIn("only supports the tasks", str(context.exception))
14391453

14401454
@parameterized.expand(SUPPORTED_ARCHITECTURES)
1455+
@pytest.mark.run_slow
1456+
@slow
14411457
def test_generate_utils(self, model_arch: str):
14421458
model_id = MODEL_NAMES[model_arch]
14431459
model = OVModelForVision2Seq.from_pretrained(model_id, export=True)

0 commit comments

Comments
 (0)