简体   繁体   中英

How to submit Dataset Input as a Parameter to AZ ML CLI run submit-pipeline command?

To submit a parameter in an az ml cli run submit-pipeline command we use the syntax:

az ml run submit-pipeline –datapaths [DataPATHS Name=datastore/datapath] --experiment-name [Experiment_Name] --parameters [String_parameters Name=Value] --pipeline-id [ID]--resource-group [RGP] --subscription-id [SUB_ID] --workspace-name [AML_WS_NAME]

This will submit Datapaths and some string parameters with the pipeline. How do we submit Dataset references using az ml cli run submit-pipeline command?

For example, the Documentation Notebook: aml-pipelines-showcasing-dataset-and-pipelineparameter

To submit a Dataset Class reference we do:

iris_tabular_ds = Dataset.Tabular.from_delimited_files('link/iris.csv')
pipeline_run_with_params = experiment.submit(pipeline, pipeline_parameters={'tabular_ds_param': iris_tabular_ds})

Using REST Call the syntax is:

response = requests.post(rest_endpoint, 
                         headers=aad_token, 
                         json={"ExperimentName": "MyRestPipeline",
                               "RunSource": "SDK",
                               "DataSetDefinitionValueAssignments": { "tabular_ds_param": {"SavedDataSetReference": {"Id": iris_tabular_ds.id}}}
                              }
                        )

What is the syntax to achieve this using az ml cli ?

To consume this from the AZ ML CLI we use the following syntax:

    curl -X POST [Pipeline_REST_Endpoint] -H "Authorization: Bearer $(az account get-access-token --query accessToken -o tsv)" -H "Content-Type: application/json" --data-binary @- <<DATA
{"ExperimentName": "[ExperimentName]",
                               "RunSource": "SDK",
                               "DataSetDefinitionValueAssignments": {"tabular_ds_param": 
                                                                     {"SavedDataSetReference": 
                                                                      {"Id":"[Dataset_ID]"}
                                                                     }
                                                                    }
                              }
DATA

We use the simple REST call because az ml run submit-pipeline does not have the dataset parameter and datapath does not achieve the desired result.

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