Skip to content

Commit 6208324

Browse files
committed
CM-2344: Implemented example of adding stage to the registered model's version.
1 parent 1d45669 commit 6208324

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

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

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ public class RegistryModelExample {
4444
static final String SOME_MODEL_VERSION = "1.0.0";
4545
static final String SOME_MODEL_VERSION_UP = "1.0.1";
4646
static final String STAGE_PRODUCTION = "production";
47+
static final String STAGE_STAGING = "staging";
4748
static final String SOME_NOTES = "some model notes";
4849

4950
/**
@@ -147,6 +148,13 @@ record = api.registerModel(updatedModel, experiment.getExperimentKey());
147148
System.out.printf("Overview of the model '%s' not found\n", registryName);
148149
}
149150

151+
// add stage to the model
152+
//
153+
System.out.printf("Adding stage `%s' to the registered model version '%s:%s'\n",
154+
STAGE_STAGING, registryName, SOME_MODEL_VERSION_UP);
155+
api.addRegistryModelVersionStage(registryName, experiment.getWorkspaceName(),
156+
SOME_MODEL_VERSION_UP, STAGE_STAGING);
157+
150158
// get details about model version
151159
//
152160
System.out.printf("Retrieving details of the model version '%s:%s'\n", registryName, SOME_MODEL_VERSION_UP);

0 commit comments

Comments
 (0)