Skip to content

Commit cac5903

Browse files
Merge pull request #227050 from santiagxf/santiagxf/azureml-batch-outputs
Update how-to-use-batch-endpoint.md
2 parents 79964cc + 5a857d9 commit cac5903

File tree

1 file changed

+28
-11
lines changed

1 file changed

+28
-11
lines changed

articles/machine-learning/how-to-use-batch-endpoint.md

Lines changed: 28 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -493,7 +493,7 @@ Invoking a batch endpoint triggers a batch scoring job. A job `name` will be ret
493493
```python
494494
job = ml_client.batch_endpoints.invoke(
495495
endpoint_name=endpoint_name,
496-
inputs=Input(path="https://pipelinedata.blob.core.windows.net/sampledata/mnist", type=AssetTypes.URI_FOLDER)
496+
inputs=Input(path="https://azuremlexampledata.blob.core.windows.net/data/mnist/sample/", type=AssetTypes.URI_FOLDER)
497497
)
498498
```
499499

@@ -511,7 +511,7 @@ job = ml_client.batch_endpoints.invoke(
511511
:::image type="content" source="./media/how-to-use-batch-endpoints-studio/job-setting-batch-scoring.png" alt-text="Screenshot of using the deployment to submit a batch job.":::
512512

513513
1. Select __Next__.
514-
1. On __Select data source__, select the data input you want to use. For this example, select __Datastore__ and in the section __Path__ enter the full URL `https://pipelinedata.blob.core.windows.net/sampledata/mnist`. Notice that this only works because the given path has public access enabled. In general, you'll need to register the data source as a __Datastore__. See [Accessing data from batch endpoints jobs](how-to-access-data-batch-endpoints-jobs.md) for details.
514+
1. On __Select data source__, select the data input you want to use. For this example, select __Datastore__ and in the section __Path__ enter the full URL `https://azuremlexampledata.blob.core.windows.net/data/mnist/sample`. Notice that this only works because the given path has public access enabled. In general, you'll need to register the data source as a __Datastore__. See [Accessing data from batch endpoints jobs](how-to-access-data-batch-endpoints-jobs.md) for details.
515515

516516
:::image type="content" source="./media/how-to-use-batch-endpoints-studio/select-datastore-job.png" alt-text="Screenshot of selecting datastore as an input option.":::
517517

@@ -541,38 +541,53 @@ Use `output-path` to configure any folder in an Azure Machine Learning registere
541541

542542
# [Python](#tab/python)
543543

544-
Use `output_path` to configure any folder in an Azure Machine Learning registered datastore. The syntax for the `--output-path` is the same as `--input` when you're specifying a folder, that is, `azureml://datastores/<datastore-name>/paths/<path-on-datastore>/`. Use `output_file_name=<your-file-name>` to configure a new output file name.
544+
Use `params_override` to configure any folder in an Azure Machine Learning registered data store. Only registered data stores are supported as output paths. In this example we will use the default data store:
545+
546+
```python
547+
batch_ds = ml_client.datastores.get_default()
548+
```
549+
550+
Once you identified the data store you want to use, configure the output as follows:
545551

546552
```python
547553
job = ml_client.batch_endpoints.invoke(
548554
endpoint_name=endpoint_name,
549-
inputs={
550-
"input": Input(path="https://pipelinedata.blob.core.windows.net/sampledata/mnist", type=AssetTypes.URI_FOLDER)
551-
},
552-
output_path={
553-
"score": Input(path=f"azureml://datastores/workspaceblobstore/paths/{endpoint_name}")
554-
},
555-
output_file_name="predictions.csv"
555+
input=Input(
556+
path="https://azuremlexampledata.blob.core.windows.net/data/mnist/sample/",
557+
type=AssetTypes.URI_FOLDER
558+
),
559+
params_override=[
560+
{ "output_dataset.datastore_id": f"azureml:{batch_ds.id}" },
561+
{ "output_dataset.path": "/mnist-batch-results" }
562+
{ "output_file_name": "mnist-predictions.csv" },
563+
]
556564
)
557565
```
558566

559567
# [Studio](#tab/azure-studio)
560568

561569
1. Navigate to the __Endpoints__ tab on the side menu.
570+
562571
1. Select the tab __Batch endpoints__.
572+
563573
1. Select the batch endpoint you just created.
574+
564575
1. Select __Create job__.
565576

566577
:::image type="content" source="./media/how-to-use-batch-endpoints-studio/create-batch-job.png" alt-text="Screenshot of the create job option to start batch scoring.":::
567578

568579
1. On __Deployment__, select the deployment you want to execute.
580+
569581
1. Select __Next__.
582+
570583
1. Check the option __Override deployment settings__.
571584

572585
:::image type="content" source="./media/how-to-use-batch-endpoints-studio/overwrite-setting.png" alt-text="Screenshot of the overwrite setting when starting a batch job.":::
573586

574587
1. You can now configure __Output file name__ and some extra properties of the deployment execution. Just this execution will be affected.
588+
575589
1. On __Select data source__, select the data input you want to use.
590+
576591
1. On __Configure output location__, check the option __Enable output configuration__.
577592

578593
:::image type="content" source="./media/how-to-use-batch-endpoints-studio/configure-output-location.png" alt-text="Screenshot of optionally configuring output location.":::
@@ -604,7 +619,9 @@ Some settings can be overwritten when invoke to make best use of the compute res
604619
```python
605620
job = ml_client.batch_endpoints.invoke(
606621
endpoint_name=endpoint_name,
607-
input=Input(path="https://pipelinedata.blob.core.windows.net/sampledata/mnist"),
622+
input=Input(
623+
path="https://azuremlexampledata.blob.core.windows.net/data/mnist/sample/"
624+
),
608625
params_override=[
609626
{ "mini_batch_size": "20" },
610627
{ "compute.instance_count": "5" }

0 commit comments

Comments
 (0)