From a4ed074d4b8c1ab0a1045bd86963ef209c3c467f Mon Sep 17 00:00:00 2001 From: Stas Bekman Date: Mon, 21 Jun 2021 16:50:12 -0700 Subject: [PATCH] reset report_to to none, avoid deprecation warning (#12293) --- tests/test_trainer.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/tests/test_trainer.py b/tests/test_trainer.py index fbabf48bc0..1247e0250d 100644 --- a/tests/test_trainer.py +++ b/tests/test_trainer.py @@ -97,6 +97,11 @@ class RegressionTrainingArguments(TrainingArguments): a: float = 0.0 b: float = 0.0 + def __post_init__(self): + super().__post_init__() + # save resources not dealing with reporting (also avoids the warning when it's not set) + self.report_to = [] + class RepeatDataset: def __init__(self, x, length=64): @@ -374,7 +379,7 @@ class TrainerIntegrationTest(TestCasePlus, TrainerIntegrationCommon): def test_training_arguments_are_left_untouched(self): trainer = get_regression_trainer() trainer.train() - args = TrainingArguments("./regression") + args = TrainingArguments("./regression", report_to=[]) dict1, dict2 = args.to_dict(), trainer.args.to_dict() for key in dict1.keys(): # Logging dir can be slightly different as they default to something with the time.