Skip to content

Commit

Permalink
Replace get_version with is_openvino_version
Browse files Browse the repository at this point in the history
  • Loading branch information
helena-intel committed Jan 9, 2024
1 parent 4f9ea99 commit fcc4497
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions tests/openvino/test_modeling.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
import torch
from datasets import load_dataset
from evaluate import evaluator
from openvino.runtime import get_version
from parameterized import parameterized
from PIL import Image
from transformers import (
Expand Down Expand Up @@ -74,6 +73,7 @@
from optimum.intel.openvino import OV_DECODER_NAME, OV_DECODER_WITH_PAST_NAME, OV_ENCODER_NAME, OV_XML_FILE_NAME
from optimum.intel.openvino.modeling_seq2seq import OVDecoder, OVEncoder
from optimum.intel.openvino.modeling_timm import TimmImageProcessor
from optimum.intel.utils.import_utils import is_openvino_version
from optimum.utils import (
DIFFUSION_MODEL_TEXT_ENCODER_SUBFOLDER,
DIFFUSION_MODEL_UNET_SUBFOLDER,
Expand Down Expand Up @@ -128,7 +128,7 @@ def test_load_from_hub_and_save_model(self):
loaded_model = OVModelForSequenceClassification.from_pretrained(self.OV_MODEL_ID, ov_config=ov_config)
self.assertTrue(manual_openvino_cache_dir.is_dir())
self.assertGreaterEqual(len(list(manual_openvino_cache_dir.glob("*.blob"))), 1)
if get_version() < "2023.3":
if is_openvino_version("<", "2023.3"):
self.assertEqual(loaded_model.request.get_property("PERFORMANCE_HINT").name, "THROUGHPUT")
else:
self.assertEqual(loaded_model.request.get_property("PERFORMANCE_HINT"), "THROUGHPUT")
Expand Down

0 comments on commit fcc4497

Please sign in to comment.