最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

How to download only a file from azure job results using Azure ML SDK? - Stack Overflow

programmeradmin0浏览0评论

I want to download only "file_test.txt" file, but nothing although the code runs nothing is downloaded:

download_path = "./downloaded_outputs"
os.makedirs(download_path, exist_ok=True)
teste = ml_client.jobs.download(
    name=returned_job.name,
    download_path="./downloaded_outputs",
    output_name="output_data/file_test.txt"
)

However, if I do output_name="output_data" the full content output_data folder is downloaded:

download_path = "./downloaded_outputs"
os.makedirs(download_path, exist_ok=True)
teste = ml_client.jobs.download(
    name=returned_job.name,
    download_path="./downloaded_outputs",
    output_name="output_data"
)

I'm using AzureML SDK v2

I want to download only "file_test.txt" file, but nothing although the code runs nothing is downloaded:

download_path = "./downloaded_outputs"
os.makedirs(download_path, exist_ok=True)
teste = ml_client.jobs.download(
    name=returned_job.name,
    download_path="./downloaded_outputs",
    output_name="output_data/file_test.txt"
)

However, if I do output_name="output_data" the full content output_data folder is downloaded:

download_path = "./downloaded_outputs"
os.makedirs(download_path, exist_ok=True)
teste = ml_client.jobs.download(
    name=returned_job.name,
    download_path="./downloaded_outputs",
    output_name="output_data"
)

I'm using AzureML SDK v2

Share Improve this question asked Mar 12 at 16:14 MiguelMiguel 3,0645 gold badges39 silver badges58 bronze badges 1
  • i guess you can not download a single file. you download all output_data file and filter it. – JayashankarGS Commented Mar 20 at 10:22
Add a comment  | 

1 Answer 1

Reset to default 0

As per this documentation the output name should be the user defined output in jobs.

It should be the key in the outputs dictionary of a job.

If you view the details of job you can see the keys in outputs dictionary like below.

So, whatever the keys present in your job outputs you can give only those as output name while download.

In your case to get only particular file, you can use fsspec library where you need pass output path from job object to AzureMachineLearningFileSystem, check more about using fsspec here .

发布评论

评论列表(0)

  1. 暂无评论