Register a model

PHOTO EMBED

Sat Apr 09 2022 15:10:24 GMT+0000 (Coordinated Universal Time)

Saved by @wessim

# 1. Register a model from an azureml.core.Run object
model = run.register_model(model_name='bidaf_onnx',
                           tags={'area': 'qna'},
                           model_path='outputs/model.onnx')
print(model.name, model.id, model.version, sep='\t')

# 2. Register a model from an azureml.train.automl.run.AutoMLRun object
description = 'My AutoML Model'
model = run.register_model(description = description,
                            tags={'area': 'qna'})

print(run.model_id)
content_copyCOPY

Azure Machine Learnings allows you to separate the deployment into two separate components, so that you can keep the same code, but merely update the model. We define the mechanism by which you upload a model separately from your code as "registering the model". When you register a model, we upload the model to the cloud (in your workspace's default storage account) and then mount it to the same compute where your webservice is running. In this example, the metric and iteration parameters aren't specified, so the iteration with the best primary metric will be registered. The model_id value returned from the run is used instead of a model name.

https://docs.microsoft.com/en-us/azure/machine-learning/how-to-deploy-and-where?tabs=python