20
20
from typing import Dict
21
21
22
22
import numpy as np
23
+ import pytest
23
24
import requests
24
25
import timm
25
26
import torch
53
54
set_seed ,
54
55
)
55
56
from transformers .onnx .utils import get_preprocessor
57
+ from transformers .testing_utils import slow
56
58
from utils_tests import MODEL_NAMES
57
59
58
60
from optimum .intel import (
@@ -364,6 +366,8 @@ def test_compare_to_transformers(self, model_arch):
364
366
gc .collect ()
365
367
366
368
@parameterized .expand (SUPPORTED_ARCHITECTURES )
369
+ @pytest .mark .run_slow
370
+ @slow
367
371
def test_pipeline (self , model_arch ):
368
372
model_id = MODEL_NAMES [model_arch ]
369
373
model = OVModelForQuestionAnswering .from_pretrained (model_id , export = True )
@@ -379,6 +383,8 @@ def test_pipeline(self, model_arch):
379
383
del model
380
384
gc .collect ()
381
385
386
+ @pytest .mark .run_slow
387
+ @slow
382
388
def test_metric (self ):
383
389
model_id = "distilbert-base-cased-distilled-squad"
384
390
set_seed (SEED )
@@ -431,6 +437,8 @@ def test_compare_to_transformers(self, model_arch):
431
437
gc .collect ()
432
438
433
439
@parameterized .expand (SUPPORTED_ARCHITECTURES )
440
+ @pytest .mark .run_slow
441
+ @slow
434
442
def test_pipeline (self , model_arch ):
435
443
model_id = MODEL_NAMES [model_arch ]
436
444
model = OVModelForTokenClassification .from_pretrained (model_id , export = True )
@@ -481,6 +489,8 @@ def test_compare_to_transformers(self, model_arch):
481
489
gc .collect ()
482
490
483
491
@parameterized .expand (SUPPORTED_ARCHITECTURES )
492
+ @pytest .mark .run_slow
493
+ @slow
484
494
def test_pipeline (self , model_arch ):
485
495
model_id = MODEL_NAMES [model_arch ]
486
496
model = OVModelForFeatureExtraction .from_pretrained (model_id , export = True )
@@ -851,6 +861,8 @@ def test_compare_to_transformers(self, model_arch):
851
861
gc .collect ()
852
862
853
863
@parameterized .expand (SUPPORTED_ARCHITECTURES )
864
+ @pytest .mark .run_slow
865
+ @slow
854
866
def test_pipeline (self , model_arch ):
855
867
model_id = MODEL_NAMES [model_arch ]
856
868
model = OVModelForImageClassification .from_pretrained (model_id , export = True )
@@ -981,6 +993,8 @@ def test_pipeline(self, model_arch):
981
993
gc .collect ()
982
994
983
995
@parameterized .expand (SUPPORTED_ARCHITECTURES )
996
+ @pytest .mark .run_slow
997
+ @slow
984
998
def test_generate_utils (self , model_arch ):
985
999
model_id = MODEL_NAMES [model_arch ]
986
1000
model = OVModelForSeq2SeqLM .from_pretrained (model_id , export = True )
@@ -1438,6 +1452,8 @@ def test_load_vanilla_transformers_which_is_not_supported(self):
1438
1452
self .assertIn ("only supports the tasks" , str (context .exception ))
1439
1453
1440
1454
@parameterized .expand (SUPPORTED_ARCHITECTURES )
1455
+ @pytest .mark .run_slow
1456
+ @slow
1441
1457
def test_generate_utils (self , model_arch : str ):
1442
1458
model_id = MODEL_NAMES [model_arch ]
1443
1459
model = OVModelForVision2Seq .from_pretrained (model_id , export = True )
0 commit comments