From b0cbcdb05b39e6c81db049d2b4d7dfc5d823210d Mon Sep 17 00:00:00 2001 From: Stas Bekman Date: Tue, 15 Sep 2020 01:01:14 -0700 Subject: [PATCH] [logging] remove no longer needed verbosity override (#7100) --- examples/bert-loses-patience/run_glue_with_pabee.py | 2 +- examples/contrib/mm-imdb/run_mmimdb.py | 2 +- examples/contrib/run_swag.py | 1 - examples/deebert/run_glue_deebert.py | 2 +- examples/distillation/run_squad_w_distillation.py | 1 - examples/movement-pruning/masked_run_glue.py | 2 +- examples/movement-pruning/masked_run_squad.py | 2 +- examples/question-answering/run_squad.py | 2 +- examples/text-classification/run_xnli.py | 2 +- templates/adding_a_new_example_script/run_xxx.py | 1 - 10 files changed, 7 insertions(+), 10 deletions(-) diff --git a/examples/bert-loses-patience/run_glue_with_pabee.py b/examples/bert-loses-patience/run_glue_with_pabee.py index 87970fcd15..d20bc34e0e 100755 --- a/examples/bert-loses-patience/run_glue_with_pabee.py +++ b/examples/bert-loses-patience/run_glue_with_pabee.py @@ -721,7 +721,7 @@ def main(): checkpoints = list( os.path.dirname(c) for c in sorted(glob.glob(args.output_dir + "/**/" + WEIGHTS_NAME, recursive=True)) ) - logging.getLogger("transformers.modeling_utils").setLevel(logging.WARN) # Reduce logging + logger.info("Evaluate the following checkpoints: %s", checkpoints) for checkpoint in checkpoints: diff --git a/examples/contrib/mm-imdb/run_mmimdb.py b/examples/contrib/mm-imdb/run_mmimdb.py index 89505454cc..0ae6303134 100644 --- a/examples/contrib/mm-imdb/run_mmimdb.py +++ b/examples/contrib/mm-imdb/run_mmimdb.py @@ -547,7 +547,7 @@ def main(): checkpoints = list( os.path.dirname(c) for c in sorted(glob.glob(args.output_dir + "/**/" + WEIGHTS_NAME, recursive=True)) ) - logging.getLogger("transformers.modeling_utils").setLevel(logging.WARN) # Reduce logging + logger.info("Evaluate the following checkpoints: %s", checkpoints) for checkpoint in checkpoints: global_step = checkpoint.split("-")[-1] if len(checkpoints) > 1 else "" diff --git a/examples/contrib/run_swag.py b/examples/contrib/run_swag.py index 2724e74822..f39041cd68 100644 --- a/examples/contrib/run_swag.py +++ b/examples/contrib/run_swag.py @@ -681,7 +681,6 @@ def main(): checkpoints = list( os.path.dirname(c) for c in sorted(glob.glob(args.output_dir + "/**/" + WEIGHTS_NAME, recursive=True)) ) - logging.getLogger("transformers.modeling_utils").setLevel(logging.WARN) # Reduce model loading logs logger.info("Evaluate the following checkpoints: %s", checkpoints) diff --git a/examples/deebert/run_glue_deebert.py b/examples/deebert/run_glue_deebert.py index 8b4270490e..a215dcb1a3 100644 --- a/examples/deebert/run_glue_deebert.py +++ b/examples/deebert/run_glue_deebert.py @@ -677,7 +677,7 @@ def main(): checkpoints = list( os.path.dirname(c) for c in sorted(glob.glob(args.output_dir + "/**/" + WEIGHTS_NAME, recursive=True)) ) - logging.getLogger("transformers.modeling_utils").setLevel(logging.WARN) # Reduce logging + logger.info("Evaluate the following checkpoints: %s", checkpoints) for checkpoint in checkpoints: global_step = checkpoint.split("-")[-1] if len(checkpoints) > 1 else "" diff --git a/examples/distillation/run_squad_w_distillation.py b/examples/distillation/run_squad_w_distillation.py index dd83e30b82..e1d7b75873 100644 --- a/examples/distillation/run_squad_w_distillation.py +++ b/examples/distillation/run_squad_w_distillation.py @@ -842,7 +842,6 @@ def main(): checkpoints = list( os.path.dirname(c) for c in sorted(glob.glob(args.output_dir + "/**/" + WEIGHTS_NAME, recursive=True)) ) - logging.getLogger("transformers.modeling_utils").setLevel(logging.WARN) # Reduce model loading logs logger.info("Evaluate the following checkpoints: %s", checkpoints) diff --git a/examples/movement-pruning/masked_run_glue.py b/examples/movement-pruning/masked_run_glue.py index 876b9fc6e3..09dfc8cf6e 100644 --- a/examples/movement-pruning/masked_run_glue.py +++ b/examples/movement-pruning/masked_run_glue.py @@ -934,7 +934,7 @@ def main(): checkpoints = list( os.path.dirname(c) for c in sorted(glob.glob(args.output_dir + "/**/" + WEIGHTS_NAME, recursive=True)) ) - logging.getLogger("transformers.modeling_utils").setLevel(logging.WARN) # Reduce logging + logger.info("Evaluate the following checkpoints: %s", checkpoints) for checkpoint in checkpoints: global_step = checkpoint.split("-")[-1] if len(checkpoints) > 1 else "" diff --git a/examples/movement-pruning/masked_run_squad.py b/examples/movement-pruning/masked_run_squad.py index 30806ff117..1311dd620d 100644 --- a/examples/movement-pruning/masked_run_squad.py +++ b/examples/movement-pruning/masked_run_squad.py @@ -1098,7 +1098,7 @@ def main(): os.path.dirname(c) for c in sorted(glob.glob(args.output_dir + "/**/" + WEIGHTS_NAME, recursive=True)) ) - logging.getLogger("transformers.modeling_utils").setLevel(logging.WARN) # Reduce model loading logs + else: logger.info("Loading checkpoint %s for evaluation", args.model_name_or_path) checkpoints = [args.model_name_or_path] diff --git a/examples/question-answering/run_squad.py b/examples/question-answering/run_squad.py index 01d00d2b79..70fc04f9d3 100644 --- a/examples/question-answering/run_squad.py +++ b/examples/question-answering/run_squad.py @@ -792,7 +792,7 @@ def main(): os.path.dirname(c) for c in sorted(glob.glob(args.output_dir + "/**/" + WEIGHTS_NAME, recursive=True)) ) - logging.getLogger("transformers.modeling_utils").setLevel(logging.WARN) # Reduce model loading logs + else: logger.info("Loading checkpoint %s for evaluation", args.model_name_or_path) checkpoints = [args.model_name_or_path] diff --git a/examples/text-classification/run_xnli.py b/examples/text-classification/run_xnli.py index 1e4a587f5d..69103708d0 100644 --- a/examples/text-classification/run_xnli.py +++ b/examples/text-classification/run_xnli.py @@ -602,7 +602,7 @@ def main(): checkpoints = list( os.path.dirname(c) for c in sorted(glob.glob(args.output_dir + "/**/" + WEIGHTS_NAME, recursive=True)) ) - logging.getLogger("transformers.modeling_utils").setLevel(logging.WARN) # Reduce logging + logger.info("Evaluate the following checkpoints: %s", checkpoints) for checkpoint in checkpoints: global_step = checkpoint.split("-")[-1] if len(checkpoints) > 1 else "" diff --git a/templates/adding_a_new_example_script/run_xxx.py b/templates/adding_a_new_example_script/run_xxx.py index 67cc154c63..2cab2a5d76 100644 --- a/templates/adding_a_new_example_script/run_xxx.py +++ b/templates/adding_a_new_example_script/run_xxx.py @@ -678,7 +678,6 @@ def main(): checkpoints = list( os.path.dirname(c) for c in sorted(glob.glob(args.output_dir + "/**/" + WEIGHTS_NAME, recursive=True)) ) - logging.getLogger("transformers.modeling_utils").setLevel(logging.WARN) # Reduce model loading logs logger.info("Evaluate the following checkpoints: %s", checkpoints)