diff --git a/benchmark/benchmark.py b/benchmark/benchmark.py index 85c181b7..d74c6e74 100644 --- a/benchmark/benchmark.py +++ b/benchmark/benchmark.py @@ -12,7 +12,7 @@ import pandas as pd import seaborn as sns from openvino import AsyncInferQueue, CompiledModel, InferRequest -from openvino.runtime import ProfilingInfo, properties +from openvino import ProfilingInfo, properties from openvino_tokenizers import convert_tokenizer from tqdm.auto import tqdm from transformers import AutoTokenizer, PreTrainedTokenizerBase diff --git a/python/openvino_tokenizers/__init__.py b/python/openvino_tokenizers/__init__.py index 9ce9b157..56f777e8 100644 --- a/python/openvino_tokenizers/__init__.py +++ b/python/openvino_tokenizers/__init__.py @@ -10,7 +10,7 @@ from typing import Callable, Optional import openvino -from openvino.runtime.utils.node_factory import NodeFactory +from openvino.utils.node_factory import NodeFactory _ext_name = "openvino_tokenizers" @@ -42,8 +42,8 @@ del _ext_name # patching openvino -old_core_init = openvino.runtime.Core.__init__ -old_factory_init = openvino.runtime.utils.node_factory.NodeFactory.__init__ +old_core_init = openvino.Core.__init__ +old_factory_init = openvino.utils.node_factory.NodeFactory.__init__ old_fe_init = openvino.frontend.frontend.FrontEnd.__init__ @@ -65,8 +65,8 @@ def new_fe_init(self, *args, **kwargs): self.add_extension(str(_ext_path)) -openvino.runtime.Core.__init__ = new_core_init -openvino.runtime.utils.node_factory.NodeFactory.__init__ = new_factory_init +openvino.Core.__init__ = new_core_init +openvino.utils.node_factory.NodeFactory.__init__ = new_factory_init openvino.frontend.frontend.FrontEnd.__init__ = new_fe_init diff --git a/python/openvino_tokenizers/build_tokenizer.py b/python/openvino_tokenizers/build_tokenizer.py index bbbea703..6c5173ca 100644 --- a/python/openvino_tokenizers/build_tokenizer.py +++ b/python/openvino_tokenizers/build_tokenizer.py @@ -1,9 +1,9 @@ from typing import Iterable, Tuple from openvino import Model, PartialShape, Type -from openvino.runtime import op -from openvino.runtime import opset12 as opset -from openvino.runtime.utils.types import make_constant_node +from openvino import op +from openvino import opset12 as opset +from openvino.utils.types import make_constant_node from openvino_tokenizers.constants import DETOKENIZER_NAME, STRING_OUTPUT_NAME, TOKEN_IDS_INPUT_NAME, TOKENIZER_NAME from openvino_tokenizers.tokenizer_pipeline import ( diff --git a/python/openvino_tokenizers/convert_tokenizer.py b/python/openvino_tokenizers/convert_tokenizer.py index 3483a95a..56b8ca5a 100644 --- a/python/openvino_tokenizers/convert_tokenizer.py +++ b/python/openvino_tokenizers/convert_tokenizer.py @@ -8,8 +8,8 @@ from functools import wraps from typing import Any, Optional, Tuple, Union -from openvino.runtime import Model, Type -from openvino.runtime.exceptions import OVTypeError +from openvino import Model, Type +from openvino.exceptions import OVTypeError from openvino_tokenizers.constants import UTF8ReplaceMode from openvino_tokenizers.utils import ( diff --git a/python/openvino_tokenizers/hf_parser.py b/python/openvino_tokenizers/hf_parser.py index e4b240c9..1fb30b50 100644 --- a/python/openvino_tokenizers/hf_parser.py +++ b/python/openvino_tokenizers/hf_parser.py @@ -12,11 +12,11 @@ from typing import Any, Callable, Dict, List, Optional, Tuple, Union import numpy as np -import openvino.runtime.opset14 as opset +import openvino.opset14 as opset from openvino import Model, PartialShape, Type -from openvino.runtime import Node, op -from openvino.runtime.exceptions import OVTypeError -from openvino.runtime.utils.types import as_node, make_constant_node +from openvino import Node, op +from openvino.exceptions import OVTypeError +from openvino.utils.types import as_node, make_constant_node from transformers import PreTrainedTokenizerBase, PreTrainedTokenizerFast from transformers.convert_slow_tokenizer import import_protobuf diff --git a/python/openvino_tokenizers/tokenizer_pipeline.py b/python/openvino_tokenizers/tokenizer_pipeline.py index ae2036a2..3d1a6aac 100644 --- a/python/openvino_tokenizers/tokenizer_pipeline.py +++ b/python/openvino_tokenizers/tokenizer_pipeline.py @@ -14,10 +14,10 @@ from typing import Any, Dict, Iterable, List, Optional, Tuple, Union import numpy as np -from openvino.runtime import Model, Output, PartialShape, Shape, Type, op -from openvino.runtime import opset12 as opset -from openvino.runtime.exceptions import OVTypeError, UserInputError -from openvino.runtime.utils.types import as_node, make_constant_node +from openvino import Model, Output, PartialShape, Shape, Type, op +from openvino import opset12 as opset +from openvino.exceptions import OVTypeError, UserInputError +from openvino.utils.types import as_node, make_constant_node from . import _get_factory from .constants import ( diff --git a/python/openvino_tokenizers/utils.py b/python/openvino_tokenizers/utils.py index ae4edba5..51eff970 100644 --- a/python/openvino_tokenizers/utils.py +++ b/python/openvino_tokenizers/utils.py @@ -10,7 +10,7 @@ from openvino import Model, Type from openvino.preprocess import PrePostProcessor -from openvino.runtime import opset12 as opset +from openvino import opset12 as opset from .constants import ( LOGITS_OUTPUT_NAME, diff --git a/tests/layer_tests.py b/tests/layer_tests.py index eac73549..90c5efde 100644 --- a/tests/layer_tests.py +++ b/tests/layer_tests.py @@ -7,7 +7,7 @@ import openvino as ov import pytest from openvino import Model, PartialShape, Type -from openvino.runtime import op +from openvino import op from openvino_tokenizers import _get_factory from openvino_tokenizers.constants import UTF8ReplaceMode from openvino_tokenizers.tokenizer_pipeline import (