From 4a872caef4e70595202c64687a074f99772d8e92 Mon Sep 17 00:00:00 2001 From: Stas Bekman Date: Fri, 25 Jun 2021 13:20:14 -0700 Subject: [PATCH] remove extra white space from log format (#12360) --- docs/source/main_classes/trainer.rst | 2 +- examples/flax/language-modeling/run_clm_flax.py | 2 +- examples/flax/language-modeling/run_mlm_flax.py | 2 +- examples/flax/summarization/run_summarization_flax.py | 2 +- examples/flax/text-classification/run_flax_glue.py | 2 +- examples/legacy/multiple_choice/run_multiple_choice.py | 2 +- examples/legacy/question-answering/run_squad.py | 2 +- examples/legacy/question-answering/run_squad_trainer.py | 2 +- examples/legacy/run_language_modeling.py | 2 +- examples/legacy/run_openai_gpt.py | 2 +- examples/legacy/run_swag.py | 2 +- examples/legacy/run_transfo_xl.py | 2 +- examples/legacy/seq2seq/finetune_trainer.py | 2 +- .../legacy/text-classification/run_tf_text_classification.py | 2 +- examples/legacy/token-classification/run_ner.py | 2 +- examples/legacy/token-classification/run_tf_ner.py | 2 +- examples/pytorch/language-modeling/run_clm.py | 2 +- examples/pytorch/language-modeling/run_clm_no_trainer.py | 2 +- examples/pytorch/language-modeling/run_mlm.py | 2 +- examples/pytorch/language-modeling/run_mlm_no_trainer.py | 2 +- examples/pytorch/language-modeling/run_plm.py | 2 +- examples/pytorch/multiple-choice/run_swag.py | 2 +- examples/pytorch/multiple-choice/run_swag_no_trainer.py | 2 +- examples/pytorch/question-answering/run_qa.py | 2 +- examples/pytorch/question-answering/run_qa_beam_search.py | 2 +- .../question-answering/run_qa_beam_search_no_trainer.py | 2 +- examples/pytorch/question-answering/run_qa_no_trainer.py | 2 +- examples/pytorch/summarization/run_summarization.py | 2 +- .../pytorch/summarization/run_summarization_no_trainer.py | 2 +- examples/pytorch/text-classification/run_glue.py | 2 +- examples/pytorch/text-classification/run_glue_no_trainer.py | 2 +- examples/pytorch/text-classification/run_xnli.py | 2 +- examples/pytorch/text-generation/run_generation.py | 2 +- examples/pytorch/token-classification/run_ner.py | 2 +- examples/pytorch/token-classification/run_ner_no_trainer.py | 2 +- examples/pytorch/translation/run_translation.py | 2 +- examples/pytorch/translation/run_translation_no_trainer.py | 2 +- examples/research_projects/adversarial/run_hans.py | 2 +- .../bert-loses-patience/run_glue_with_pabee.py | 2 +- examples/research_projects/deebert/run_glue_deebert.py | 2 +- .../distillation/run_squad_w_distillation.py | 2 +- .../research_projects/distillation/scripts/binarized_data.py | 2 +- .../research_projects/distillation/scripts/token_counts.py | 2 +- examples/research_projects/mlm_wwm/run_mlm_wwm.py | 2 +- examples/research_projects/mm-imdb/run_mmimdb.py | 2 +- .../research_projects/movement-pruning/masked_run_glue.py | 2 +- .../research_projects/movement-pruning/masked_run_squad.py | 2 +- examples/research_projects/performer/run_mlm_performer.py | 2 +- examples/research_projects/wav2vec2/run_asr.py | 2 +- examples/research_projects/wav2vec2/run_common_voice.py | 2 +- examples/research_projects/wav2vec2/run_pretrain.py | 2 +- .../zero-shot-distillation/distill_classifier.py | 2 +- examples/tensorflow/multiple-choice/run_tf_multiple_choice.py | 2 +- examples/tensorflow/question-answering/run_qa.py | 2 +- examples/tensorflow/text-classification/run_glue.py | 2 +- .../tensorflow/text-classification/run_text_classification.py | 2 +- .../run_{{cookiecutter.example_shortcut}}.py | 4 ++-- tests/sagemaker/scripts/pytorch/run_glue_model_parallelism.py | 2 +- 58 files changed, 59 insertions(+), 59 deletions(-) diff --git a/docs/source/main_classes/trainer.rst b/docs/source/main_classes/trainer.rst index 21586e8772f..a6314e32539 100644 --- a/docs/source/main_classes/trainer.rst +++ b/docs/source/main_classes/trainer.rst @@ -147,7 +147,7 @@ Here is an example of how this can be used in an application: # Setup logging logging.basicConfig( - format="%(asctime)s - %(levelname)s - %(name)s - %(message)s", + format="%(asctime)s - %(levelname)s - %(name)s - %(message)s", datefmt="%m/%d/%Y %H:%M:%S", handlers=[logging.StreamHandler(sys.stdout)], ) diff --git a/examples/flax/language-modeling/run_clm_flax.py b/examples/flax/language-modeling/run_clm_flax.py index 9d049227549..ace918ec488 100644 --- a/examples/flax/language-modeling/run_clm_flax.py +++ b/examples/flax/language-modeling/run_clm_flax.py @@ -267,7 +267,7 @@ def main(): # Make one log on every process with the configuration for debugging. logging.basicConfig( - format="%(asctime)s - %(levelname)s - %(name)s - %(message)s", + format="%(asctime)s - %(levelname)s - %(name)s - %(message)s", datefmt="%m/%d/%Y %H:%M:%S", level=logging.INFO, ) diff --git a/examples/flax/language-modeling/run_mlm_flax.py b/examples/flax/language-modeling/run_mlm_flax.py index ff38b0090ee..8810468fb6d 100755 --- a/examples/flax/language-modeling/run_mlm_flax.py +++ b/examples/flax/language-modeling/run_mlm_flax.py @@ -308,7 +308,7 @@ if __name__ == "__main__": # Setup logging logging.basicConfig( - format="%(asctime)s - %(levelname)s - %(name)s - %(message)s", + format="%(asctime)s - %(levelname)s - %(name)s - %(message)s", level="NOTSET", datefmt="[%X]", ) diff --git a/examples/flax/summarization/run_summarization_flax.py b/examples/flax/summarization/run_summarization_flax.py index cc61f07f080..e8c683c5fff 100644 --- a/examples/flax/summarization/run_summarization_flax.py +++ b/examples/flax/summarization/run_summarization_flax.py @@ -313,7 +313,7 @@ def main(): # Make one log on every process with the configuration for debugging. logging.basicConfig( - format="%(asctime)s - %(levelname)s - %(name)s - %(message)s", + format="%(asctime)s - %(levelname)s - %(name)s - %(message)s", datefmt="%m/%d/%Y %H:%M:%S", level=logging.INFO, ) diff --git a/examples/flax/text-classification/run_flax_glue.py b/examples/flax/text-classification/run_flax_glue.py index 14862f7726b..edb13a6a40f 100755 --- a/examples/flax/text-classification/run_flax_glue.py +++ b/examples/flax/text-classification/run_flax_glue.py @@ -249,7 +249,7 @@ def main(): # Make one log on every process with the configuration for debugging. logging.basicConfig( - format="%(asctime)s - %(levelname)s - %(name)s - %(message)s", + format="%(asctime)s - %(levelname)s - %(name)s - %(message)s", datefmt="%m/%d/%Y %H:%M:%S", level=logging.INFO, ) diff --git a/examples/legacy/multiple_choice/run_multiple_choice.py b/examples/legacy/multiple_choice/run_multiple_choice.py index bf79f2ac7a8..aeb9b9dc434 100644 --- a/examples/legacy/multiple_choice/run_multiple_choice.py +++ b/examples/legacy/multiple_choice/run_multiple_choice.py @@ -107,7 +107,7 @@ def main(): # Setup logging logging.basicConfig( - format="%(asctime)s - %(levelname)s - %(name)s - %(message)s", + format="%(asctime)s - %(levelname)s - %(name)s - %(message)s", datefmt="%m/%d/%Y %H:%M:%S", level=logging.INFO if training_args.local_rank in [-1, 0] else logging.WARN, ) diff --git a/examples/legacy/question-answering/run_squad.py b/examples/legacy/question-answering/run_squad.py index fd50bf06b77..fbf2ebd6351 100644 --- a/examples/legacy/question-answering/run_squad.py +++ b/examples/legacy/question-answering/run_squad.py @@ -702,7 +702,7 @@ def main(): # Setup logging logging.basicConfig( - format="%(asctime)s - %(levelname)s - %(name)s - %(message)s", + format="%(asctime)s - %(levelname)s - %(name)s - %(message)s", datefmt="%m/%d/%Y %H:%M:%S", level=logging.INFO if args.local_rank in [-1, 0] else logging.WARN, ) diff --git a/examples/legacy/question-answering/run_squad_trainer.py b/examples/legacy/question-answering/run_squad_trainer.py index 1b1d6e6fed4..7089326372e 100644 --- a/examples/legacy/question-answering/run_squad_trainer.py +++ b/examples/legacy/question-answering/run_squad_trainer.py @@ -89,7 +89,7 @@ def main(): # Setup logging logging.basicConfig( - format="%(asctime)s - %(levelname)s - %(name)s - %(message)s", + format="%(asctime)s - %(levelname)s - %(name)s - %(message)s", datefmt="%m/%d/%Y %H:%M:%S", level=logging.INFO if training_args.local_rank in [-1, 0] else logging.WARN, ) diff --git a/examples/legacy/run_language_modeling.py b/examples/legacy/run_language_modeling.py index 20995f1bfaa..12b62f5d816 100755 --- a/examples/legacy/run_language_modeling.py +++ b/examples/legacy/run_language_modeling.py @@ -211,7 +211,7 @@ def main(): # Setup logging logging.basicConfig( - format="%(asctime)s - %(levelname)s - %(name)s - %(message)s", + format="%(asctime)s - %(levelname)s - %(name)s - %(message)s", datefmt="%m/%d/%Y %H:%M:%S", level=logging.INFO if training_args.local_rank in [-1, 0] else logging.WARN, ) diff --git a/examples/legacy/run_openai_gpt.py b/examples/legacy/run_openai_gpt.py index 1c0c189420c..2af3e267d2e 100755 --- a/examples/legacy/run_openai_gpt.py +++ b/examples/legacy/run_openai_gpt.py @@ -50,7 +50,7 @@ from transformers import ( logging.basicConfig( - format="%(asctime)s - %(levelname)s - %(name)s - %(message)s", datefmt="%m/%d/%Y %H:%M:%S", level=logging.INFO + format="%(asctime)s - %(levelname)s - %(name)s - %(message)s", datefmt="%m/%d/%Y %H:%M:%S", level=logging.INFO ) logger = logging.getLogger(__name__) diff --git a/examples/legacy/run_swag.py b/examples/legacy/run_swag.py index 666c1becb3f..e7760410892 100755 --- a/examples/legacy/run_swag.py +++ b/examples/legacy/run_swag.py @@ -617,7 +617,7 @@ def main(): # Setup logging logging.basicConfig( - format="%(asctime)s - %(levelname)s - %(name)s - %(message)s", + format="%(asctime)s - %(levelname)s - %(name)s - %(message)s", datefmt="%m/%d/%Y %H:%M:%S", level=logging.INFO if args.local_rank in [-1, 0] else logging.WARN, ) diff --git a/examples/legacy/run_transfo_xl.py b/examples/legacy/run_transfo_xl.py index 71f3efa2a88..7ee94115085 100755 --- a/examples/legacy/run_transfo_xl.py +++ b/examples/legacy/run_transfo_xl.py @@ -33,7 +33,7 @@ from transformers import TransfoXLCorpus, TransfoXLLMHeadModel logging.basicConfig( - format="%(asctime)s - %(levelname)s - %(name)s - %(message)s", datefmt="%m/%d/%Y %H:%M:%S", level=logging.INFO + format="%(asctime)s - %(levelname)s - %(name)s - %(message)s", datefmt="%m/%d/%Y %H:%M:%S", level=logging.INFO ) logger = logging.getLogger(__name__) diff --git a/examples/legacy/seq2seq/finetune_trainer.py b/examples/legacy/seq2seq/finetune_trainer.py index 37573e50bad..3efc8f90f25 100755 --- a/examples/legacy/seq2seq/finetune_trainer.py +++ b/examples/legacy/seq2seq/finetune_trainer.py @@ -163,7 +163,7 @@ def main(): # Setup logging logging.basicConfig( - format="%(asctime)s - %(levelname)s - %(name)s - %(message)s", + format="%(asctime)s - %(levelname)s - %(name)s - %(message)s", datefmt="%m/%d/%Y %H:%M:%S", level=logging.INFO if training_args.local_rank in [-1, 0] else logging.WARN, ) diff --git a/examples/legacy/text-classification/run_tf_text_classification.py b/examples/legacy/text-classification/run_tf_text_classification.py index 0b31ee30df3..3564775f30d 100755 --- a/examples/legacy/text-classification/run_tf_text_classification.py +++ b/examples/legacy/text-classification/run_tf_text_classification.py @@ -220,7 +220,7 @@ def main(): # Setup logging logging.basicConfig( - format="%(asctime)s - %(levelname)s - %(name)s - %(message)s", + format="%(asctime)s - %(levelname)s - %(name)s - %(message)s", datefmt="%m/%d/%Y %H:%M:%S", level=logging.INFO, ) diff --git a/examples/legacy/token-classification/run_ner.py b/examples/legacy/token-classification/run_ner.py index 983c60ee7d2..a653ecb91c6 100644 --- a/examples/legacy/token-classification/run_ner.py +++ b/examples/legacy/token-classification/run_ner.py @@ -131,7 +131,7 @@ def main(): # Setup logging logging.basicConfig( - format="%(asctime)s - %(levelname)s - %(name)s - %(message)s", + format="%(asctime)s - %(levelname)s - %(name)s - %(message)s", datefmt="%m/%d/%Y %H:%M:%S", level=logging.INFO if training_args.local_rank in [-1, 0] else logging.WARN, ) diff --git a/examples/legacy/token-classification/run_tf_ner.py b/examples/legacy/token-classification/run_tf_ner.py index 93fe93617fb..0169a10f24a 100755 --- a/examples/legacy/token-classification/run_tf_ner.py +++ b/examples/legacy/token-classification/run_tf_ner.py @@ -127,7 +127,7 @@ def main(): # Setup logging logging.basicConfig( - format="%(asctime)s - %(levelname)s - %(name)s - %(message)s", + format="%(asctime)s - %(levelname)s - %(name)s - %(message)s", datefmt="%m/%d/%Y %H:%M:%S", level=logging.INFO, ) diff --git a/examples/pytorch/language-modeling/run_clm.py b/examples/pytorch/language-modeling/run_clm.py index f3dbd244902..5f28662af76 100755 --- a/examples/pytorch/language-modeling/run_clm.py +++ b/examples/pytorch/language-modeling/run_clm.py @@ -199,7 +199,7 @@ def main(): # Setup logging logging.basicConfig( - format="%(asctime)s - %(levelname)s - %(name)s - %(message)s", + format="%(asctime)s - %(levelname)s - %(name)s - %(message)s", datefmt="%m/%d/%Y %H:%M:%S", handlers=[logging.StreamHandler(sys.stdout)], ) diff --git a/examples/pytorch/language-modeling/run_clm_no_trainer.py b/examples/pytorch/language-modeling/run_clm_no_trainer.py index 906aa1af552..2d51b8a6551 100755 --- a/examples/pytorch/language-modeling/run_clm_no_trainer.py +++ b/examples/pytorch/language-modeling/run_clm_no_trainer.py @@ -200,7 +200,7 @@ def main(): accelerator = Accelerator() # Make one log on every process with the configuration for debugging. logging.basicConfig( - format="%(asctime)s - %(levelname)s - %(name)s - %(message)s", + format="%(asctime)s - %(levelname)s - %(name)s - %(message)s", datefmt="%m/%d/%Y %H:%M:%S", level=logging.INFO, ) diff --git a/examples/pytorch/language-modeling/run_mlm.py b/examples/pytorch/language-modeling/run_mlm.py index 69b755c9753..48f642712eb 100755 --- a/examples/pytorch/language-modeling/run_mlm.py +++ b/examples/pytorch/language-modeling/run_mlm.py @@ -208,7 +208,7 @@ def main(): # Setup logging logging.basicConfig( - format="%(asctime)s - %(levelname)s - %(name)s - %(message)s", + format="%(asctime)s - %(levelname)s - %(name)s - %(message)s", datefmt="%m/%d/%Y %H:%M:%S", handlers=[logging.StreamHandler(sys.stdout)], ) diff --git a/examples/pytorch/language-modeling/run_mlm_no_trainer.py b/examples/pytorch/language-modeling/run_mlm_no_trainer.py index e280b375f4a..e5203f3f9a5 100755 --- a/examples/pytorch/language-modeling/run_mlm_no_trainer.py +++ b/examples/pytorch/language-modeling/run_mlm_no_trainer.py @@ -212,7 +212,7 @@ def main(): accelerator = Accelerator() # Make one log on every process with the configuration for debugging. logging.basicConfig( - format="%(asctime)s - %(levelname)s - %(name)s - %(message)s", + format="%(asctime)s - %(levelname)s - %(name)s - %(message)s", datefmt="%m/%d/%Y %H:%M:%S", level=logging.INFO, ) diff --git a/examples/pytorch/language-modeling/run_plm.py b/examples/pytorch/language-modeling/run_plm.py index 7cce0953017..28d5c7f3162 100755 --- a/examples/pytorch/language-modeling/run_plm.py +++ b/examples/pytorch/language-modeling/run_plm.py @@ -205,7 +205,7 @@ def main(): # Setup logging logging.basicConfig( - format="%(asctime)s - %(levelname)s - %(name)s - %(message)s", + format="%(asctime)s - %(levelname)s - %(name)s - %(message)s", datefmt="%m/%d/%Y %H:%M:%S", handlers=[logging.StreamHandler(sys.stdout)], ) diff --git a/examples/pytorch/multiple-choice/run_swag.py b/examples/pytorch/multiple-choice/run_swag.py index 18b233af44b..a18742117b3 100755 --- a/examples/pytorch/multiple-choice/run_swag.py +++ b/examples/pytorch/multiple-choice/run_swag.py @@ -216,7 +216,7 @@ def main(): # Setup logging logging.basicConfig( - format="%(asctime)s - %(levelname)s - %(name)s - %(message)s", + format="%(asctime)s - %(levelname)s - %(name)s - %(message)s", datefmt="%m/%d/%Y %H:%M:%S", handlers=[logging.StreamHandler(sys.stdout)], ) diff --git a/examples/pytorch/multiple-choice/run_swag_no_trainer.py b/examples/pytorch/multiple-choice/run_swag_no_trainer.py index 3bd41e09bb6..320bfc7a2c5 100755 --- a/examples/pytorch/multiple-choice/run_swag_no_trainer.py +++ b/examples/pytorch/multiple-choice/run_swag_no_trainer.py @@ -240,7 +240,7 @@ def main(): accelerator = Accelerator() # Make one log on every process with the configuration for debugging. logging.basicConfig( - format="%(asctime)s - %(levelname)s - %(name)s - %(message)s", + format="%(asctime)s - %(levelname)s - %(name)s - %(message)s", datefmt="%m/%d/%Y %H:%M:%S", level=logging.INFO, ) diff --git a/examples/pytorch/question-answering/run_qa.py b/examples/pytorch/question-answering/run_qa.py index d5aa2228cf0..b036f3214f5 100755 --- a/examples/pytorch/question-answering/run_qa.py +++ b/examples/pytorch/question-answering/run_qa.py @@ -212,7 +212,7 @@ def main(): # Setup logging logging.basicConfig( - format="%(asctime)s - %(levelname)s - %(name)s - %(message)s", + format="%(asctime)s - %(levelname)s - %(name)s - %(message)s", datefmt="%m/%d/%Y %H:%M:%S", handlers=[logging.StreamHandler(sys.stdout)], ) diff --git a/examples/pytorch/question-answering/run_qa_beam_search.py b/examples/pytorch/question-answering/run_qa_beam_search.py index 6e60f760092..7e2717b891a 100755 --- a/examples/pytorch/question-answering/run_qa_beam_search.py +++ b/examples/pytorch/question-answering/run_qa_beam_search.py @@ -211,7 +211,7 @@ def main(): # Setup logging logging.basicConfig( - format="%(asctime)s - %(levelname)s - %(name)s - %(message)s", + format="%(asctime)s - %(levelname)s - %(name)s - %(message)s", datefmt="%m/%d/%Y %H:%M:%S", handlers=[logging.StreamHandler(sys.stdout)], ) diff --git a/examples/pytorch/question-answering/run_qa_beam_search_no_trainer.py b/examples/pytorch/question-answering/run_qa_beam_search_no_trainer.py index 80a45d35fd1..764e71a875c 100644 --- a/examples/pytorch/question-answering/run_qa_beam_search_no_trainer.py +++ b/examples/pytorch/question-answering/run_qa_beam_search_no_trainer.py @@ -238,7 +238,7 @@ def main(): accelerator = Accelerator() # Make one log on every process with the configuration for debugging. logging.basicConfig( - format="%(asctime)s - %(levelname)s - %(name)s - %(message)s", + format="%(asctime)s - %(levelname)s - %(name)s - %(message)s", datefmt="%m/%d/%Y %H:%M:%S", level=logging.INFO, ) diff --git a/examples/pytorch/question-answering/run_qa_no_trainer.py b/examples/pytorch/question-answering/run_qa_no_trainer.py index 99239c863c2..9eced712bcc 100755 --- a/examples/pytorch/question-answering/run_qa_no_trainer.py +++ b/examples/pytorch/question-answering/run_qa_no_trainer.py @@ -267,7 +267,7 @@ def main(): accelerator = Accelerator() # Make one log on every process with the configuration for debugging. logging.basicConfig( - format="%(asctime)s - %(levelname)s - %(name)s - %(message)s", + format="%(asctime)s - %(levelname)s - %(name)s - %(message)s", datefmt="%m/%d/%Y %H:%M:%S", level=logging.INFO, ) diff --git a/examples/pytorch/summarization/run_summarization.py b/examples/pytorch/summarization/run_summarization.py index a439374dff7..21541b428df 100755 --- a/examples/pytorch/summarization/run_summarization.py +++ b/examples/pytorch/summarization/run_summarization.py @@ -256,7 +256,7 @@ def main(): # Setup logging logging.basicConfig( - format="%(asctime)s - %(levelname)s - %(name)s - %(message)s", + format="%(asctime)s - %(levelname)s - %(name)s - %(message)s", datefmt="%m/%d/%Y %H:%M:%S", handlers=[logging.StreamHandler(sys.stdout)], ) diff --git a/examples/pytorch/summarization/run_summarization_no_trainer.py b/examples/pytorch/summarization/run_summarization_no_trainer.py index 9f4b8f79996..00ba1b4d4cc 100644 --- a/examples/pytorch/summarization/run_summarization_no_trainer.py +++ b/examples/pytorch/summarization/run_summarization_no_trainer.py @@ -293,7 +293,7 @@ def main(): accelerator = Accelerator() # Make one log on every process with the configuration for debugging. logging.basicConfig( - format="%(asctime)s - %(levelname)s - %(name)s - %(message)s", + format="%(asctime)s - %(levelname)s - %(name)s - %(message)s", datefmt="%m/%d/%Y %H:%M:%S", level=logging.INFO, ) diff --git a/examples/pytorch/text-classification/run_glue.py b/examples/pytorch/text-classification/run_glue.py index 33b63e6042c..3531c03e317 100755 --- a/examples/pytorch/text-classification/run_glue.py +++ b/examples/pytorch/text-classification/run_glue.py @@ -200,7 +200,7 @@ def main(): # Setup logging logging.basicConfig( - format="%(asctime)s - %(levelname)s - %(name)s - %(message)s", + format="%(asctime)s - %(levelname)s - %(name)s - %(message)s", datefmt="%m/%d/%Y %H:%M:%S", handlers=[logging.StreamHandler(sys.stdout)], ) diff --git a/examples/pytorch/text-classification/run_glue_no_trainer.py b/examples/pytorch/text-classification/run_glue_no_trainer.py index aa2e03ef77f..5fd64a0f5ea 100644 --- a/examples/pytorch/text-classification/run_glue_no_trainer.py +++ b/examples/pytorch/text-classification/run_glue_no_trainer.py @@ -168,7 +168,7 @@ def main(): accelerator = Accelerator() # Make one log on every process with the configuration for debugging. logging.basicConfig( - format="%(asctime)s - %(levelname)s - %(name)s - %(message)s", + format="%(asctime)s - %(levelname)s - %(name)s - %(message)s", datefmt="%m/%d/%Y %H:%M:%S", level=logging.INFO, ) diff --git a/examples/pytorch/text-classification/run_xnli.py b/examples/pytorch/text-classification/run_xnli.py index 3da10ff0b41..4043bc1c84d 100755 --- a/examples/pytorch/text-classification/run_xnli.py +++ b/examples/pytorch/text-classification/run_xnli.py @@ -170,7 +170,7 @@ def main(): # Setup logging logging.basicConfig( - format="%(asctime)s - %(levelname)s - %(name)s - %(message)s", + format="%(asctime)s - %(levelname)s - %(name)s - %(message)s", datefmt="%m/%d/%Y %H:%M:%S", handlers=[logging.StreamHandler(sys.stdout)], ) diff --git a/examples/pytorch/text-generation/run_generation.py b/examples/pytorch/text-generation/run_generation.py index efb9578738c..9b4b09fc968 100755 --- a/examples/pytorch/text-generation/run_generation.py +++ b/examples/pytorch/text-generation/run_generation.py @@ -41,7 +41,7 @@ from transformers import ( logging.basicConfig( - format="%(asctime)s - %(levelname)s - %(name)s - %(message)s", + format="%(asctime)s - %(levelname)s - %(name)s - %(message)s", datefmt="%m/%d/%Y %H:%M:%S", level=logging.INFO, ) diff --git a/examples/pytorch/token-classification/run_ner.py b/examples/pytorch/token-classification/run_ner.py index 52c1af08ce5..646347a2758 100755 --- a/examples/pytorch/token-classification/run_ner.py +++ b/examples/pytorch/token-classification/run_ner.py @@ -191,7 +191,7 @@ def main(): # Setup logging logging.basicConfig( - format="%(asctime)s - %(levelname)s - %(name)s - %(message)s", + format="%(asctime)s - %(levelname)s - %(name)s - %(message)s", datefmt="%m/%d/%Y %H:%M:%S", handlers=[logging.StreamHandler(sys.stdout)], ) diff --git a/examples/pytorch/token-classification/run_ner_no_trainer.py b/examples/pytorch/token-classification/run_ner_no_trainer.py index 26990f68c25..7a68a333c26 100755 --- a/examples/pytorch/token-classification/run_ner_no_trainer.py +++ b/examples/pytorch/token-classification/run_ner_no_trainer.py @@ -221,7 +221,7 @@ def main(): accelerator = Accelerator() # Make one log on every process with the configuration for debugging. logging.basicConfig( - format="%(asctime)s - %(levelname)s - %(name)s - %(message)s", + format="%(asctime)s - %(levelname)s - %(name)s - %(message)s", datefmt="%m/%d/%Y %H:%M:%S", level=logging.INFO, ) diff --git a/examples/pytorch/translation/run_translation.py b/examples/pytorch/translation/run_translation.py index f653c736100..680ab4fd503 100755 --- a/examples/pytorch/translation/run_translation.py +++ b/examples/pytorch/translation/run_translation.py @@ -241,7 +241,7 @@ def main(): # Setup logging logging.basicConfig( - format="%(asctime)s - %(levelname)s - %(name)s - %(message)s", + format="%(asctime)s - %(levelname)s - %(name)s - %(message)s", datefmt="%m/%d/%Y %H:%M:%S", handlers=[logging.StreamHandler(sys.stdout)], ) diff --git a/examples/pytorch/translation/run_translation_no_trainer.py b/examples/pytorch/translation/run_translation_no_trainer.py index e6569e6aaa1..e2d953f82e4 100644 --- a/examples/pytorch/translation/run_translation_no_trainer.py +++ b/examples/pytorch/translation/run_translation_no_trainer.py @@ -264,7 +264,7 @@ def main(): # Make one log on every process with the configuration for debugging. logging.basicConfig( - format="%(asctime)s - %(levelname)s - %(name)s - %(message)s", + format="%(asctime)s - %(levelname)s - %(name)s - %(message)s", datefmt="%m/%d/%Y %H:%M:%S", level=logging.INFO, ) diff --git a/examples/research_projects/adversarial/run_hans.py b/examples/research_projects/adversarial/run_hans.py index 9cc6a0a86ef..31acbd3a8a6 100644 --- a/examples/research_projects/adversarial/run_hans.py +++ b/examples/research_projects/adversarial/run_hans.py @@ -115,7 +115,7 @@ def main(): # Setup logging logging.basicConfig( - format="%(asctime)s - %(levelname)s - %(name)s - %(message)s", + format="%(asctime)s - %(levelname)s - %(name)s - %(message)s", datefmt="%m/%d/%Y %H:%M:%S", level=logging.INFO if training_args.local_rank in [-1, 0] else logging.WARN, ) diff --git a/examples/research_projects/bert-loses-patience/run_glue_with_pabee.py b/examples/research_projects/bert-loses-patience/run_glue_with_pabee.py index c5d0633fdab..def4dff7766 100755 --- a/examples/research_projects/bert-loses-patience/run_glue_with_pabee.py +++ b/examples/research_projects/bert-loses-patience/run_glue_with_pabee.py @@ -621,7 +621,7 @@ def main(): # Setup logging logging.basicConfig( - format="%(asctime)s - %(levelname)s - %(name)s - %(message)s", + format="%(asctime)s - %(levelname)s - %(name)s - %(message)s", datefmt="%m/%d/%Y %H:%M:%S", level=logging.INFO if args.local_rank in [-1, 0] else logging.WARN, ) diff --git a/examples/research_projects/deebert/run_glue_deebert.py b/examples/research_projects/deebert/run_glue_deebert.py index fce491e7901..5bfc2f8816d 100644 --- a/examples/research_projects/deebert/run_glue_deebert.py +++ b/examples/research_projects/deebert/run_glue_deebert.py @@ -571,7 +571,7 @@ def main(): # Setup logging logging.basicConfig( - format="%(asctime)s - %(levelname)s - %(name)s - %(message)s", + format="%(asctime)s - %(levelname)s - %(name)s - %(message)s", datefmt="%m/%d/%Y %H:%M:%S", level=logging.INFO if args.local_rank in [-1, 0] else logging.WARN, ) diff --git a/examples/research_projects/distillation/run_squad_w_distillation.py b/examples/research_projects/distillation/run_squad_w_distillation.py index 3d2320490fa..e73f8f1c430 100644 --- a/examples/research_projects/distillation/run_squad_w_distillation.py +++ b/examples/research_projects/distillation/run_squad_w_distillation.py @@ -734,7 +734,7 @@ def main(): # Setup logging logging.basicConfig( - format="%(asctime)s - %(levelname)s - %(name)s - %(message)s", + format="%(asctime)s - %(levelname)s - %(name)s - %(message)s", datefmt="%m/%d/%Y %H:%M:%S", level=logging.INFO if args.local_rank in [-1, 0] else logging.WARN, ) diff --git a/examples/research_projects/distillation/scripts/binarized_data.py b/examples/research_projects/distillation/scripts/binarized_data.py index 8e34b29dccc..951530d5c75 100644 --- a/examples/research_projects/distillation/scripts/binarized_data.py +++ b/examples/research_projects/distillation/scripts/binarized_data.py @@ -27,7 +27,7 @@ from transformers import BertTokenizer, GPT2Tokenizer, RobertaTokenizer logging.basicConfig( - format="%(asctime)s - %(levelname)s - %(name)s - %(message)s", datefmt="%m/%d/%Y %H:%M:%S", level=logging.INFO + format="%(asctime)s - %(levelname)s - %(name)s - %(message)s", datefmt="%m/%d/%Y %H:%M:%S", level=logging.INFO ) logger = logging.getLogger(__name__) diff --git a/examples/research_projects/distillation/scripts/token_counts.py b/examples/research_projects/distillation/scripts/token_counts.py index 0238bf66f86..aa223fda703 100644 --- a/examples/research_projects/distillation/scripts/token_counts.py +++ b/examples/research_projects/distillation/scripts/token_counts.py @@ -22,7 +22,7 @@ from collections import Counter logging.basicConfig( - format="%(asctime)s - %(levelname)s - %(name)s - %(message)s", datefmt="%m/%d/%Y %H:%M:%S", level=logging.INFO + format="%(asctime)s - %(levelname)s - %(name)s - %(message)s", datefmt="%m/%d/%Y %H:%M:%S", level=logging.INFO ) logger = logging.getLogger(__name__) diff --git a/examples/research_projects/mlm_wwm/run_mlm_wwm.py b/examples/research_projects/mlm_wwm/run_mlm_wwm.py index 5f1926c1b13..c97fc33b868 100644 --- a/examples/research_projects/mlm_wwm/run_mlm_wwm.py +++ b/examples/research_projects/mlm_wwm/run_mlm_wwm.py @@ -201,7 +201,7 @@ def main(): # Setup logging logging.basicConfig( - format="%(asctime)s - %(levelname)s - %(name)s - %(message)s", + format="%(asctime)s - %(levelname)s - %(name)s - %(message)s", datefmt="%m/%d/%Y %H:%M:%S", handlers=[logging.StreamHandler(sys.stdout)], ) diff --git a/examples/research_projects/mm-imdb/run_mmimdb.py b/examples/research_projects/mm-imdb/run_mmimdb.py index 7f6f25dd6b4..c73aec5c874 100644 --- a/examples/research_projects/mm-imdb/run_mmimdb.py +++ b/examples/research_projects/mm-imdb/run_mmimdb.py @@ -466,7 +466,7 @@ def main(): # Setup logging logging.basicConfig( - format="%(asctime)s - %(levelname)s - %(name)s - %(message)s", + format="%(asctime)s - %(levelname)s - %(name)s - %(message)s", datefmt="%m/%d/%Y %H:%M:%S", level=logging.INFO if args.local_rank in [-1, 0] else logging.WARN, ) diff --git a/examples/research_projects/movement-pruning/masked_run_glue.py b/examples/research_projects/movement-pruning/masked_run_glue.py index 7a74d0724ca..85a832a02d1 100644 --- a/examples/research_projects/movement-pruning/masked_run_glue.py +++ b/examples/research_projects/movement-pruning/masked_run_glue.py @@ -824,7 +824,7 @@ def main(): # Setup logging logging.basicConfig( - format="%(asctime)s - %(levelname)s - %(name)s - %(message)s", + format="%(asctime)s - %(levelname)s - %(name)s - %(message)s", datefmt="%m/%d/%Y %H:%M:%S", level=logging.INFO if args.local_rank in [-1, 0] else logging.WARN, ) diff --git a/examples/research_projects/movement-pruning/masked_run_squad.py b/examples/research_projects/movement-pruning/masked_run_squad.py index a1c1cf2cfc6..28b963f25da 100644 --- a/examples/research_projects/movement-pruning/masked_run_squad.py +++ b/examples/research_projects/movement-pruning/masked_run_squad.py @@ -985,7 +985,7 @@ def main(): # Setup logging logging.basicConfig( - format="%(asctime)s - %(levelname)s - %(name)s - %(message)s", + format="%(asctime)s - %(levelname)s - %(name)s - %(message)s", datefmt="%m/%d/%Y %H:%M:%S", level=logging.INFO if args.local_rank in [-1, 0] else logging.WARN, ) diff --git a/examples/research_projects/performer/run_mlm_performer.py b/examples/research_projects/performer/run_mlm_performer.py index 056dd0f27f3..c09e654e4ed 100644 --- a/examples/research_projects/performer/run_mlm_performer.py +++ b/examples/research_projects/performer/run_mlm_performer.py @@ -467,7 +467,7 @@ if __name__ == "__main__": # Setup logging logging.basicConfig( - format="%(asctime)s - %(levelname)s - %(name)s - %(message)s", + format="%(asctime)s - %(levelname)s - %(name)s - %(message)s", level="NOTSET", datefmt="[%X]", ) diff --git a/examples/research_projects/wav2vec2/run_asr.py b/examples/research_projects/wav2vec2/run_asr.py index 426643e0a4b..ffb31d7739e 100755 --- a/examples/research_projects/wav2vec2/run_asr.py +++ b/examples/research_projects/wav2vec2/run_asr.py @@ -65,7 +65,7 @@ class ModelArguments: def configure_logger(model_args: ModelArguments, training_args: TrainingArguments): logging.basicConfig( - format="%(asctime)s - %(levelname)s - %(name)s - %(message)s", + format="%(asctime)s - %(levelname)s - %(name)s - %(message)s", datefmt="%m/%d/%Y %H:%M:%S", handlers=[logging.StreamHandler(sys.stdout)], ) diff --git a/examples/research_projects/wav2vec2/run_common_voice.py b/examples/research_projects/wav2vec2/run_common_voice.py index 0f89dcf2b47..bb69784a8d2 100644 --- a/examples/research_projects/wav2vec2/run_common_voice.py +++ b/examples/research_projects/wav2vec2/run_common_voice.py @@ -285,7 +285,7 @@ def main(): # Setup logging logging.basicConfig( - format="%(asctime)s - %(levelname)s - %(name)s - %(message)s", + format="%(asctime)s - %(levelname)s - %(name)s - %(message)s", datefmt="%m/%d/%Y %H:%M:%S", handlers=[logging.StreamHandler(sys.stdout)], ) diff --git a/examples/research_projects/wav2vec2/run_pretrain.py b/examples/research_projects/wav2vec2/run_pretrain.py index e0081e1dda4..491537b2ebd 100755 --- a/examples/research_projects/wav2vec2/run_pretrain.py +++ b/examples/research_projects/wav2vec2/run_pretrain.py @@ -70,7 +70,7 @@ class ModelArguments: def configure_logger(model_args: ModelArguments, training_args: TrainingArguments): logging.basicConfig( - format="%(asctime)s - %(levelname)s - %(name)s - %(message)s", + format="%(asctime)s - %(levelname)s - %(name)s - %(message)s", datefmt="%m/%d/%Y %H:%M:%S", handlers=[logging.StreamHandler(sys.stdout)], ) diff --git a/examples/research_projects/zero-shot-distillation/distill_classifier.py b/examples/research_projects/zero-shot-distillation/distill_classifier.py index 52ce7c5e570..16d52214376 100644 --- a/examples/research_projects/zero-shot-distillation/distill_classifier.py +++ b/examples/research_projects/zero-shot-distillation/distill_classifier.py @@ -245,7 +245,7 @@ def main(): # Setup logging logging.basicConfig( - format="%(asctime)s - %(levelname)s - %(name)s - %(message)s", + format="%(asctime)s - %(levelname)s - %(name)s - %(message)s", datefmt="%m/%d/%Y %H:%M:%S", handlers=[logging.StreamHandler(sys.stdout)], ) diff --git a/examples/tensorflow/multiple-choice/run_tf_multiple_choice.py b/examples/tensorflow/multiple-choice/run_tf_multiple_choice.py index dec38bea343..84d58d92070 100755 --- a/examples/tensorflow/multiple-choice/run_tf_multiple_choice.py +++ b/examples/tensorflow/multiple-choice/run_tf_multiple_choice.py @@ -111,7 +111,7 @@ def main(): # Setup logging logging.basicConfig( - format="%(asctime)s - %(levelname)s - %(name)s - %(message)s", + format="%(asctime)s - %(levelname)s - %(name)s - %(message)s", datefmt="%m/%d/%Y %H:%M:%S", level=logging.INFO, ) diff --git a/examples/tensorflow/question-answering/run_qa.py b/examples/tensorflow/question-answering/run_qa.py index 492678aa896..021c63473a6 100755 --- a/examples/tensorflow/question-answering/run_qa.py +++ b/examples/tensorflow/question-answering/run_qa.py @@ -293,7 +293,7 @@ def main(): # region Logging logging.basicConfig( - format="%(asctime)s - %(levelname)s - %(name)s - %(message)s", + format="%(asctime)s - %(levelname)s - %(name)s - %(message)s", datefmt="%m/%d/%Y %H:%M:%S", handlers=[logging.StreamHandler(sys.stdout)], ) diff --git a/examples/tensorflow/text-classification/run_glue.py b/examples/tensorflow/text-classification/run_glue.py index cd10e751144..b439ffb3430 100644 --- a/examples/tensorflow/text-classification/run_glue.py +++ b/examples/tensorflow/text-classification/run_glue.py @@ -255,7 +255,7 @@ def main(): # region Logging logging.basicConfig( - format="%(asctime)s - %(levelname)s - %(name)s - %(message)s", + format="%(asctime)s - %(levelname)s - %(name)s - %(message)s", datefmt="%m/%d/%Y %H:%M:%S", handlers=[logging.StreamHandler(sys.stdout)], ) diff --git a/examples/tensorflow/text-classification/run_text_classification.py b/examples/tensorflow/text-classification/run_text_classification.py index 27324f59d4b..a52d79ef1de 100644 --- a/examples/tensorflow/text-classification/run_text_classification.py +++ b/examples/tensorflow/text-classification/run_text_classification.py @@ -247,7 +247,7 @@ def main(): # region Logging logging.basicConfig( - format="%(asctime)s - %(levelname)s - %(name)s - %(message)s", + format="%(asctime)s - %(levelname)s - %(name)s - %(message)s", datefmt="%m/%d/%Y %H:%M:%S", handlers=[logging.StreamHandler(sys.stdout)], ) diff --git a/templates/adding_a_new_example_script/{{cookiecutter.directory_name}}/run_{{cookiecutter.example_shortcut}}.py b/templates/adding_a_new_example_script/{{cookiecutter.directory_name}}/run_{{cookiecutter.example_shortcut}}.py index a7af2159832..f9bace88878 100755 --- a/templates/adding_a_new_example_script/{{cookiecutter.directory_name}}/run_{{cookiecutter.example_shortcut}}.py +++ b/templates/adding_a_new_example_script/{{cookiecutter.directory_name}}/run_{{cookiecutter.example_shortcut}}.py @@ -222,7 +222,7 @@ def main(): # Setup logging logging.basicConfig( - format="%(asctime)s - %(levelname)s - %(name)s - %(message)s", + format="%(asctime)s - %(levelname)s - %(name)s - %(message)s", datefmt="%m/%d/%Y %H:%M:%S", handlers=[logging.StreamHandler(sys.stdout)], ) @@ -658,7 +658,7 @@ def main(): accelerator = Accelerator() # Make one log on every process with the configuration for debugging. logging.basicConfig( - format="%(asctime)s - %(levelname)s - %(name)s - %(message)s", + format="%(asctime)s - %(levelname)s - %(name)s - %(message)s", datefmt="%m/%d/%Y %H:%M:%S", level=logging.INFO, ) diff --git a/tests/sagemaker/scripts/pytorch/run_glue_model_parallelism.py b/tests/sagemaker/scripts/pytorch/run_glue_model_parallelism.py index 2021392930d..4b31b9cfe8e 100644 --- a/tests/sagemaker/scripts/pytorch/run_glue_model_parallelism.py +++ b/tests/sagemaker/scripts/pytorch/run_glue_model_parallelism.py @@ -206,7 +206,7 @@ def main(): # Setup logging logging.basicConfig( - format="%(asctime)s - %(levelname)s - %(name)s - %(message)s", + format="%(asctime)s - %(levelname)s - %(name)s - %(message)s", datefmt="%m/%d/%Y %H:%M:%S", handlers=[logging.StreamHandler(sys.stdout)], )