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

Suppress TensorFlow info messages to debug level #721

Merged
merged 8 commits into from
Aug 3, 2023
Merged
Changes from 1 commit
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
Next Next commit
Suppress TF info messages during import
  • Loading branch information
juhoinkinen committed Jul 31, 2023
commit c115aa367f56a24be826afd7d89ab299d3d0b91a
5 changes: 5 additions & 0 deletions annif/backend/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""Registry of backend types for Annif"""
from __future__ import annotations

import os
from typing import TYPE_CHECKING, Type

if TYPE_CHECKING:
Expand Down Expand Up @@ -43,8 +44,12 @@ def _mllm() -> Type[AnnifBackend]:

def _nn_ensemble() -> Type[AnnifBackend]:
try:
os.environ["TF_CPP_MIN_LOG_LEVEL"] = "1"

from . import nn_ensemble

os.environ["TF_CPP_MIN_LOG_LEVEL"] = "0"

return nn_ensemble.NNEnsembleBackend
except ImportError:
raise ValueError(
Expand Down