Skip to content

Commit

Permalink
Fix valid model URL might be overridden by an invalid one in case the…
Browse files Browse the repository at this point in the history
… upload failed
  • Loading branch information
allegroai committed Aug 21, 2024
1 parent a981941 commit 0086785
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions clearml/backend_interface/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -378,10 +378,13 @@ def callback(uploaded_uri):
if uploaded_uri is None:
return

# If not successful, mark model as failed_uploading
# If not successful, mark model as failed_uploading,
# but dont override valid urls
if uploaded_uri is False:
uploaded_uri = "{}/failed_uploading".format(
self._upload_storage_uri
uploaded_uri = (
self.data.uri
if self.data.uri != "{}/uploading_file".format(self._upload_storage_uri or "file://")
else "{}/failed_uploading".format(self._upload_storage_uri or "file://")
)

Model._local_model_to_id_uri[str(model_file)] = (
Expand Down

0 comments on commit 0086785

Please sign in to comment.