From f45b3e3ce39ca48047c67d818749076a266f7185 Mon Sep 17 00:00:00 2001 From: allegroai <> Date: Mon, 31 Jan 2022 10:50:08 +0200 Subject: [PATCH] Allow overriding auto_delete_file in Task.update_output_model() (#554) --- clearml/backend_interface/task/task.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/clearml/backend_interface/task/task.py b/clearml/backend_interface/task/task.py index e82bf5e7..e62b2085 100644 --- a/clearml/backend_interface/task/task.py +++ b/clearml/backend_interface/task/task.py @@ -793,6 +793,7 @@ class Task(IdObjectBase, AccessMixin, SetupUploadMixin): tags=None, # type: Optional[Sequence[str]] model_name=None, # type: Optional[str] iteration=None, # type: Optional[int] + auto_delete_file=True # type: bool ): # type: (...) -> str """ @@ -810,6 +811,10 @@ class Task(IdObjectBase, AccessMixin, SetupUploadMixin): :param model_name: If provided the model name as it will appear in the model artifactory. (Optional) Default: Task.name - name :param iteration: iteration number for the current stored model (Optional) + :param bool auto_delete_file: Delete the temporary file after uploading (Optional) + + - ``True`` - Delete (Default) + - ``False`` - Do not delete :return: The URI of the uploaded weights file. Notice: upload is done is a background thread, while the function call returns immediately @@ -822,7 +827,9 @@ class Task(IdObjectBase, AccessMixin, SetupUploadMixin): comment=comment ) output_model.connect(task=self, name=name) - url = output_model.update_weights(weights_filename=model_path, iteration=iteration) + url = output_model.update_weights( + weights_filename=model_path, iteration=iteration, auto_delete_file=auto_delete_file + ) return url @property