Skip to content

Commit 3b98d76

Browse files
committed
CM-2372: Implemented example to demonstrate how to update version details of the registry model.
1 parent 9a455fd commit 3b98d76

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

comet-examples/src/main/java/ml/comet/examples/RegistryModelExample.java

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -193,6 +193,16 @@ record = api.registerModel(updatedModel, experiment.getExperimentKey());
193193
api.updateRegistryModel(registryName, experiment.getWorkspaceName(), newModelName, newDescription);
194194
System.out.println("Model was successfully updated");
195195

196+
// update registry model version details
197+
//
198+
System.out.printf("Updating version details of the registry model '%s/%s:%s'.\n",
199+
experiment.getWorkspaceName(), newModelName, SOME_MODEL_VERSION_UP);
200+
String newComment = "updated version comment";
201+
List<String> newStages = Collections.singletonList("updated stage");
202+
api.updateRegistryModelVersion(newModelName, experiment.getWorkspaceName(), SOME_MODEL_VERSION_UP,
203+
newComment, newStages);
204+
System.out.printf("Model version details was successfully updated for: %s\n", SOME_MODEL_VERSION_UP);
205+
196206
} finally {
197207
PathUtils.deleteDirectory(modelTmpDir);
198208
}

0 commit comments

Comments
 (0)