Hello @tarek Kerbadj
Thanks for using Microsoft Q&A platform. If you have a locally trained or retrained model, you can register it with Azure. After it's registered, you can continue tuning it by using Azure compute or deploy it by using Azure facilities like Azure Kubernetes Service or Triton Inference Server (Preview).
To be used with the Azure Machine Learning Python SDK, a model must be stored as a serialized Python object in pickle format (a .pkl file). It must also implement a predict(data) method that returns a JSON-serializable object. For example, you might store a locally trained scikit-learn diabetes model with:
import joblib
from sklearn.datasets import load_diabetes
from sklearn.linear_model import Ridge
dataset_x, dataset_y = load_diabetes(return_X_y=True)
sk_model = Ridge().fit(dataset_x, dataset_y)
joblib.dump(sk_model, "sklearn_regression_model.pkl")
To make the model available in Azure, you can then use the register() method of the Model class:
from azureml.core.model import Model
model = Model.register(model_path="sklearn_regression_model.pkl",
model_name="sklearn_regression_model",
tags={'area': "diabetes", 'type': "regression"},
description="Ridge regression model to predict diabetes",
workspace=ws)
You can then find your newly registered model on the Azure Machine Learning Model tab:
To see step by step guidance, please refer to the document - https://learn.microsoft.com/en-us/azure/machine-learning/how-to-deploy-local
I hope this helps! Let me know if you have more questions, feel free to post under this tag.
Regards,
Yutong
-Please kindly accept the answer if you feel helpful to support the community, thanks a lot.