[英]How give azure machine learning dataset path in an inference script?
I am using azureml sdk in Azure Databricks.我在 Azure Databricks 中使用 azureml sdk。
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.当我在数据块单元格中编写用于推理 model (%%writefile script.py) 的脚本时,我尝试加载我在 Azure 机器学习数据集中加载的 .bin 文件。
I would like to do this in the script.py:我想在 script.py 中这样做:
fasttext.load_model(azuremldatasetpath)
How can I do to give good dataset path of my.bin file in azuremldatasetpath variable?如何在 azuremldatasetpath 变量中提供 my.bin 文件的良好数据集路径? (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.您可以使用您的 model 名称和Model.get_model_path()方法来检索本地文件系统上 model 文件的路径。 If you register a folder or a collection of files, this API returns the path of the directory that contains those files.
如果注册文件夹或文件集合,则此 API 返回包含这些文件的目录的路径。
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更多信息你可能想参考: https://learn.microsoft.com/en-us/azure/machine-learning/how-to-deploy-advanced-entry-script#azureml_model_dir
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.