From c79d12502f5483f95a6aaecca5363b5ecc2e995d Mon Sep 17 00:00:00 2001 From: Disty0 Date: Sun, 9 Feb 2025 02:01:54 +0300 Subject: [PATCH] Fix messed up logging with OpenVINO --- modules/intel/openvino/__init__.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/modules/intel/openvino/__init__.py b/modules/intel/openvino/__init__.py index f2681d134..d6dd73567 100644 --- a/modules/intel/openvino/__init__.py +++ b/modules/intel/openvino/__init__.py @@ -23,6 +23,17 @@ import functools from modules import shared, devices, sd_models +# importing openvino.runtime forces DeprecationWarning to "always" +# And Intel's own libs (NNCF) imports the deprecated module +# Reset the warnings back to ignore: +try: + import warnings + import openvino.runtime # pylint: disable=unused-import + warnings.filterwarnings(action="ignore", category=DeprecationWarning) +except Exception: + pass + + torch._dynamo.config.cache_size_limit = 64 # pylint: disable=protected-access torch._dynamo.eval_frame.check_if_dynamo_supported = lambda: True # pylint: disable=protected-access if hasattr(torch._dynamo.config, "inline_inbuilt_nn_modules"):