Skip to content

Commit

Permalink
Replace openvino.runtime imports with openvino (openvinotoolkit#1579)
Browse files Browse the repository at this point in the history
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
  • Loading branch information
helena-intel authored Jan 20, 2025
1 parent d3da17e commit 5f7512d
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 5 deletions.
2 changes: 1 addition & 1 deletion tools/llm_bench/benchmark.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import argparse
import logging as log
import llm_bench_utils.model_utils
from openvino.runtime import get_version
from openvino import get_version
import torch
import traceback
from llm_bench_utils.memory_profile import MemConsumption
Expand Down
2 changes: 1 addition & 1 deletion tools/llm_bench/convert.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
from diffusers import UNet2DConditionModel, AutoencoderTiny, LCMScheduler
from nncf.torch.model_creation import is_wrapped_model
from openvino import Type as OVType, PartialShape, save_model, convert_model
from openvino.runtime import Core, get_version
from openvino import Core, get_version
from optimum.exporters import TasksManager
from optimum.utils import DEFAULT_DUMMY_SHAPES
from optimum.intel.openvino.configuration import OVConfig
Expand Down
2 changes: 1 addition & 1 deletion tools/llm_bench/llm_bench_utils/ov_model_classes.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
from diffusers.pipelines.pipeline_utils import DiffusionPipeline, ImagePipelineOutput
from optimum.intel.openvino import OVModelForCausalLM
from optimum.intel.openvino.utils import ONNX_WEIGHTS_NAME, OV_XML_FILE_NAME
from openvino.runtime import Model, Core, Tensor, Type
from openvino import Model, Core, Tensor, Type
from transformers import PretrainedConfig
from transformers.modeling_outputs import CausalLMOutputWithPast, ModelOutput
from transformers import GenerationConfig, StoppingCriteriaList
Expand Down
7 changes: 5 additions & 2 deletions tools/llm_bench/llm_bench_utils/ov_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# SPDX-License-Identifier: Apache-2.0
from pathlib import Path
from transformers import AutoConfig, AutoProcessor, AutoTokenizer
from openvino.runtime import Core
from openvino import Core
import openvino as ov
import logging as log
import torch
Expand All @@ -17,7 +17,10 @@
DEFAULT_MODEL_CLASSES,
IMAGE_GEN_CLS
)
import openvino.runtime.opset13 as opset
try:
import openvino.opset13 as opset
except ImportError:
import openvino.runtime.opset13 as opset
from transformers import pipeline
import openvino_genai as ov_genai
import queue
Expand Down

0 comments on commit 5f7512d

Please sign in to comment.