fix: replace deprecated openvino.runtime imports with openvino namespace in helper scripts#3369
Conversation
|
Thank you for the contribution, but this PR doesn't actually replace the deprecated imports — it makes the except ImportError fallback identical to the try block two lines above, effectively turning the try/except into dead code. The current pattern is intentional: The openvino.runtime import in the except branch is a backward-compatibility fallback, not the primary import path. It only runs when the modern from openvino import ... is unavailable (i.e., on older OpenVINO versions). After this PR, both branches would execute the same from openvino import opset13, so if it fails in try, it will also fail in except — removing the fallback entirely while keeping a meaningless try/except wrapper. Closing as the change would reduce compatibility without any functional benefit. |
Summary
Fixes deprecated
openvino.runtimesub-module imports across 9 helper scripts.Problem
The
openvino.runtimenested namespace was deprecated and is removed inOpenVINO 2026.0. Any script using
from openvino.runtime import ...willthrow an ImportError on the current release.
Related: https://github.com/openvinotoolkit/openvino/blob/master/docs/release_notes/index.md
Changes
Updated the following 9 files:
notebooks/glm4-v/ov_glm4v_helper.pynotebooks/janus-multimodal-generation/ov_janus_helper.pynotebooks/minicpm-o-omnimodal-chatbot/minicpm_o_helper.pynotebooks/minicpm-o-4.5/minicpm_o_4_5_helper.pynotebooks/qwen2-audio/ov_qwen2_audio_helper.pynotebooks/qwen2.5-omni-chatbot/qwen2_5_omni_helper.pynotebooks/qwen3-asr/qwen_3_asr_helper.pynotebooks/qwen3-tts/qwen_3_tts_helper.pynotebooks/ct-segmentation-quantize/custom_segmentation.pyFix applied in each file:
Testing
Verified zero remaining deprecated imports using:
Output: empty (all fixed)