I am using azureml sdk in Azure Databricks.
When I write the script for inference model (%%writefile script.py) in a databricks cell, I try to load a .bin file that I loaded in Azure Machine Learning Datasets.
I would like to do this in the script.py:
fasttext.load_model(azuremldatasetpath)
How can I do to give good dataset path of my .bin file in azuremldatasetpath variable ? (Without calling workspace in the script).
Something like:
dataset_path = os.path.join(os.getenv('AZUREML_MODEL_DIR'), 'file.bin')
You can use your model name with the Model.get_model_path() method to retrieve the path of the model file or files on the local file system. If you register a folder or a collection of files, this API returns the path of the directory that contains those files.
More info you may want to refer: https://learn.microsoft.com/en-us/azure/machine-learning/how-to-deploy-advanced-entry-script#azureml_model_dir