Skip to content

Commit

Permalink
Fix hydra binds breaks in offline mode (#1215)
Browse files Browse the repository at this point in the history
  • Loading branch information
allegroai committed Mar 21, 2024
1 parent 96ae6a9 commit 6d1ac2d
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions clearml/backend_interface/task/task.py
Original file line number Diff line number Diff line change
Expand Up @@ -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) -> ()
Expand Down

0 comments on commit 6d1ac2d

Please sign in to comment.