Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Disable future warnings/info messages on import #748

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions optimum/intel/openvino/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
# limitations under the License.

import logging
import warnings

from ..utils.import_utils import is_accelerate_available, is_diffusers_available, is_nncf_available
from .utils import (
Expand All @@ -25,9 +26,15 @@
)


warnings.simplefilter(action="ignore", category=FutureWarning)


if is_nncf_available():
logging.disable(logging.INFO)
import nncf

logging.disable(logging.NOTSET)

# Suppress version mismatch logging
nncf.set_log_level(logging.ERROR)
from nncf.torch import patch_torch_operators
Expand Down
Loading