disable tf/keras logging on first import

This commit is contained in:
kba 2025-11-26 16:37:54 +01:00
parent 9d9d32daed
commit 0f410c2e7c
2 changed files with 5 additions and 1 deletions

View file

@ -25,7 +25,9 @@ class EynollahCliCtx:
"--model-basedir", "--model-basedir",
"-m", "-m",
help="directory of models", help="directory of models",
type=click.Path(exists=True), # NOTE: not mandatory to exist so --help for subcommands works but will log a warning
# and raise exception when trying to load models in the CLI
# type=click.Path(exists=True),
default=f'{os.getcwd()}/models_eynollah', default=f'{os.getcwd()}/models_eynollah',
) )
@click.option( @click.option(

View file

@ -1,7 +1,9 @@
""" """
Load libraries with possible race conditions once. This must be imported as the first module of eynollah. Load libraries with possible race conditions once. This must be imported as the first module of eynollah.
""" """
from ocrd_utils import tf_disable_interactive_logs
from torch import * from torch import *
tf_disable_interactive_logs()
import tensorflow.keras import tensorflow.keras
from shapely import * from shapely import *
imported_libs = True imported_libs = True