简体   繁体   中英

How give azure machine learning dataset path in an inference script?

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM