'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')


Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source