Search code examples
pytorchazure-machine-learning-serviceazureml-python-sdksentence-transformers

Register Sentencetransformer model on Azure ML


Basically title. The Azure documentation for v2 is constantly getting updated, and as of now i have no resource to find out how you can register a pre-trained model from SentenceTransformers on AzureML for future use in endpoints. The library is based on Pytorch, but so far I've had no luck in using MLFlow(mentioned in the docs) to register it.

I don't have much code to show, so any help whatsoever would be appreciated.


Solution

  • With MLFlow, you have to first save or log your model before you can register it. But with log_model you can do both in one step

      mlflow.pytorch.log_model(model, "my_model_path", registered_model_name="fancy")
    

    Then it is easiest to deploy it from the AzureML Studio: enter image description here