diff --git a/docs/source/main_classes/trainer.rst b/docs/source/main_classes/trainer.rst index 21586e8772..a6314e3253 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 9d04922754..ace918ec48 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 ff38b0090e..8810468fb6 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 cc61f07f08..e8c683c5ff 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 14862f7726..edb13a6a40 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 bf79f2ac7a..aeb9b9dc43 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 fd50bf06b7..fbf2ebd635 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 1b1d6e6fed..7089326372 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 20995f1bfa..12b62f5d81 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 1c0c189420..2af3e267d2 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 666c1becb3..e776041089 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 71f3efa2a8..7ee9411508 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 37573e50ba..3efc8f90f2 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 0b31ee30df..3564775f30 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 983c60ee7d..a653ecb91c 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 93fe93617f..0169a10f24 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 f3dbd24490..5f28662af7 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 906aa1af55..2d51b8a655 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 69b755c975..48f642712e 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 e280b375f4..e5203f3f9a 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 7cce095301..28d5c7f316 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 18b233af44..a18742117b 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 3bd41e09bb..320bfc7a2c 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 d5aa2228cf..b036f3214f 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 6e60f76009..7e2717b891 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 80a45d35fd..764e71a875 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 99239c863c..9eced712bc 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 a439374dff..21541b428d 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 9f4b8f7999..00ba1b4d4c 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 33b63e6042..3531c03e31 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 aa2e03ef77..5fd64a0f5e 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 3da10ff0b4..4043bc1c84 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 efb9578738..9b4b09fc96 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 52c1af08ce..646347a275 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 26990f68c2..7a68a333c2 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 f653c73610..680ab4fd50 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 e6569e6aaa..e2d953f82e 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 9cc6a0a86e..31acbd3a8a 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 c5d0633fda..def4dff776 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 fce491e790..5bfc2f8816 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 3d2320490f..e73f8f1c43 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 8e34b29dcc..951530d5c7 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 0238bf66f8..aa223fda70 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 5f1926c1b1..c97fc33b86 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 7f6f25dd6b..c73aec5c87 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 7a74d0724c..85a832a02d 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 a1c1cf2cfc..28b963f25d 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 056dd0f27f..c09e654e4e 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 426643e0a4..ffb31d7739 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 0f89dcf2b4..bb69784a8d 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 e0081e1dda..491537b2eb 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 52ce7c5e57..16d5221437 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 dec38bea34..84d58d9207 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 492678aa89..021c63473a 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 cd10e75114..b439ffb343 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 27324f59d4..a52d79ef1d 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 a7af215983..f9bace8887 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 2021392930..4b31b9cfe8 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)], )