JobMonitor.register_model()
Registers a trained model in the snowflake model registry. The model is registered under the specified name and version in the specified database and schema that the native app has permissions to.
This method is available only for jobs of type train or train_inference and requires a valid model_run_id. Duplicate version names for a model are not allowed.
⚠️ Note: Ensure the native app has the necessary permissions to the specified database and schema.
-- grant access to resources needed for snowflake experiment tracking
GRANT USAGE ON DATABASE <DATABASE> TO APPLICATION RELATIONALAI;GRANT USAGE ON SCHEMA <DATABASE>.<SCHEMA> TO APPLICATION RELATIONALAI;GRANT CREATE MODEL ON SCHEMA <DATABASE>.<SCHEMA> TO APPLICATION RELATIONALAI;Parameters
Section titled “Parameters”| Name | Type | Description | Optional |
|---|---|---|---|
model_name | str | Name under which to register the model. | No |
version_name | str | Version under which to register the model. | No |
database_name | str | Database where the model will be registered. | No |
schema_name | str | Schema name in the database where the model will be registered. | No |
comment | str | Optional comment for model registration. | Yes |
Example
Section titled “Example”train_job.register_model( model_name="new_model", version_name="v3", database_name="database_name", schema_name="schema_name", comment="Production-ready model",)