Skip to content

Commit 5f7512d

Browse files
authored
Replace openvino.runtime imports with openvino (openvinotoolkit#1579)
openvino.runtime will be removed in 2026.0 and we now see DeprecationWarnings with nightly: ``` <frozen importlib.util>:262: DeprecationWarning: The `openvino.runtime` module is deprecated and will be removed in the 2026.0 release. Please replace `openvino.runtime` with `openvino`. ``` PR for OpenVINO Tokenizers: openvinotoolkit/openvino_tokenizers#378
1 parent d3da17e commit 5f7512d

File tree

4 files changed

+8
-5
lines changed

4 files changed

+8
-5
lines changed

tools/llm_bench/benchmark.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
import argparse
77
import logging as log
88
import llm_bench_utils.model_utils
9-
from openvino.runtime import get_version
9+
from openvino import get_version
1010
import torch
1111
import traceback
1212
from llm_bench_utils.memory_profile import MemConsumption

tools/llm_bench/convert.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
from diffusers import UNet2DConditionModel, AutoencoderTiny, LCMScheduler
2121
from nncf.torch.model_creation import is_wrapped_model
2222
from openvino import Type as OVType, PartialShape, save_model, convert_model
23-
from openvino.runtime import Core, get_version
23+
from openvino import Core, get_version
2424
from optimum.exporters import TasksManager
2525
from optimum.utils import DEFAULT_DUMMY_SHAPES
2626
from optimum.intel.openvino.configuration import OVConfig

tools/llm_bench/llm_bench_utils/ov_model_classes.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
from diffusers.pipelines.pipeline_utils import DiffusionPipeline, ImagePipelineOutput
1717
from optimum.intel.openvino import OVModelForCausalLM
1818
from optimum.intel.openvino.utils import ONNX_WEIGHTS_NAME, OV_XML_FILE_NAME
19-
from openvino.runtime import Model, Core, Tensor, Type
19+
from openvino import Model, Core, Tensor, Type
2020
from transformers import PretrainedConfig
2121
from transformers.modeling_outputs import CausalLMOutputWithPast, ModelOutput
2222
from transformers import GenerationConfig, StoppingCriteriaList

tools/llm_bench/llm_bench_utils/ov_utils.py

+5-2
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
# SPDX-License-Identifier: Apache-2.0
44
from pathlib import Path
55
from transformers import AutoConfig, AutoProcessor, AutoTokenizer
6-
from openvino.runtime import Core
6+
from openvino import Core
77
import openvino as ov
88
import logging as log
99
import torch
@@ -17,7 +17,10 @@
1717
DEFAULT_MODEL_CLASSES,
1818
IMAGE_GEN_CLS
1919
)
20-
import openvino.runtime.opset13 as opset
20+
try:
21+
import openvino.opset13 as opset
22+
except ImportError:
23+
import openvino.runtime.opset13 as opset
2124
from transformers import pipeline
2225
import openvino_genai as ov_genai
2326
import queue

0 commit comments

Comments
 (0)