From 6b079d27c68ddd47e76188d16bcec82c56731457 Mon Sep 17 00:00:00 2001 From: alpertunga-bile Date: Mon, 23 Dec 2024 21:29:15 +0300 Subject: [PATCH] check for report_to variable is added --- src/transformers/integrations/integration_utils.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/transformers/integrations/integration_utils.py b/src/transformers/integrations/integration_utils.py index e1f3bccb842fd1..25ebb49bcfd297 100755 --- a/src/transformers/integrations/integration_utils.py +++ b/src/transformers/integrations/integration_utils.py @@ -2151,6 +2151,17 @@ def on_train_end(self, args, state, control, **kwargs): def get_reporting_integration_callbacks(report_to): + if report_to is None: + return [] + + if isinstance(report_to, str): + if "none" == report_to: + return [] + elif "all" == report_to: + report_to = get_available_reporting_integrations() + else: + report_to = [report_to] + for integration in report_to: if integration not in INTEGRATION_TO_CALLBACK: raise ValueError(