From 6d1ac2db6aa64336e7df99b6584f938f60eaebea Mon Sep 17 00:00:00 2001 From: allegroai <> Date: Thu, 21 Mar 2024 21:50:44 +0200 Subject: [PATCH] Fix hydra binds breaks in offline mode (#1215) --- clearml/backend_interface/task/task.py | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/clearml/backend_interface/task/task.py b/clearml/backend_interface/task/task.py index cafbe409..71e36a74 100644 --- a/clearml/backend_interface/task/task.py +++ b/clearml/backend_interface/task/task.py @@ -1360,13 +1360,19 @@ def delete_parameter(self, name, force=False): "Delete hyper-parameter is not supported by your clearml-server, " "upgrade to the latest version") + force_kwargs = {} + if Session.check_min_api_version("2.13"): + force_kwargs["force"] = force + with self._edit_lock: - paramkey = tasks.ParamKey(section=name.split('/', 1)[0], name=name.split('/', 1)[1]) - res = self.send(tasks.DeleteHyperParamsRequest( - task=self.id, hyperparams=[paramkey], force=force), raise_on_errors=False) + paramkey = tasks.ParamKey(section=name.split("/", 1)[0], name=name.split("/", 1)[1]) + res = self.send( + tasks.DeleteHyperParamsRequest(task=self.id, hyperparams=[paramkey], **force_kwargs), + raise_on_errors=False, + ) self.reload() - return res.ok() + return res.ok() if not self._offline_mode else True def update_parameters(self, *args, **kwargs): # type: (*dict, **Any) -> ()