Skip to content

Commit 739b6ee

Browse files
committed
Exclude the model version set OCID from the model details when updating the model.
1 parent edca89b commit 739b6ee

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

ads/model/service/oci_datascience_model.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -423,10 +423,13 @@ def update(self) -> "OCIDataScienceModel":
423423
OCIDataScienceModel
424424
The `OCIDataScienceModel` instance (self).
425425
"""
426+
model_details = self.to_oci_model(UpdateModelDetails)
427+
428+
# Clean up the model version set, otherwise it throws an error that model is already
429+
# associated with the model version set.
430+
model_details.model_version_set_id = None
426431
return self.update_from_oci_model(
427-
self.client.update_model(
428-
self.id, self.to_oci_model(UpdateModelDetails)
429-
).data
432+
self.client.update_model(self.id, model_details).data
430433
)
431434

432435
@check_for_model_id(

0 commit comments

Comments
 (0)