Respect documentation on passive log level (#21700)

* Respect documentation on passive log level

* Fix test and set log level in examples

* Add doc
This commit is contained in:
Sylvain Gugger
2023-02-22 09:39:18 +01:00
committed by GitHub
parent ee6e71e29c
commit b19d64d852
20 changed files with 85 additions and 9 deletions

View File

@@ -272,6 +272,10 @@ def main():
handlers=[logging.StreamHandler(sys.stdout)],
)
if training_args.should_log:
# The default of training_args.log_level is passive, so we set log level at info here to have that default.
transformers.utils.logging.set_verbosity_info()
log_level = training_args.get_process_log_level()
logger.setLevel(log_level)
datasets.utils.logging.set_verbosity(log_level)