From df6d42a9141cd369af2293f0767a8169a58ce54f Mon Sep 17 00:00:00 2001 From: alpertunga-bile Date: Fri, 17 Jan 2025 16:39:32 +0300 Subject: [PATCH] check is added for the report_to variable in TrainingArguments (#35403) 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 55cefad6874295..50c0496526b4e1 100755 --- a/src/transformers/integrations/integration_utils.py +++ b/src/transformers/integrations/integration_utils.py @@ -2157,6 +2157,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(