You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: articles/machine-learning/how-to-deploy-online-endpoints.md
+7-3Lines changed: 7 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -375,18 +375,18 @@ For supported general-purpose and GPU instance types, see [Managed online endpoi
375
375
376
376
### Use more than one model
377
377
378
-
Currently, you can specify only one model per deployment in the YAML. If you've more than one model, when you register the model, copy all the models as files or subdirectories into a folder that you use for registration. In your scoring script, use the environment variable `AZUREML_MODEL_DIR` to get the path to the model root folder. The underlying directory structure is retained. For an example of deploying multiple models to one deployment, see [Deploy multiple models to one deployment](https://github.com/Azure/azureml-examples/blob/main/cli/endpoints/online/custom-container/minimal/multimodel/README.md).
378
+
Currently, you can specify only one model per deployment in the YAML. If you've more than one model, when you register the model, copy all the models as files or subdirectories into a folder that you use for registration. In your scoring script, use the environment variable `AZUREML_MODEL_DIR` to get the path to the model root folder. The underlying directory structure is retained. For an example of deploying multiple models to one deployment, see [Deploy multiple models to one deployment](https://github.com/Azure/azureml-examples/blob/main/cli/endpoints/online/custom-container/minimal/multimodel).
379
379
380
380
## Understand the scoring script
381
381
382
382
> [!TIP]
383
383
> The format of the scoring script for online endpoints is the same format that's used in the preceding version of the CLI and in the Python SDK.
384
384
385
385
# [Azure CLI](#tab/azure-cli)
386
-
As noted earlier, the script specified in`code_configuration.scoring_script` must have an `init()` function and a `run()` function. This example uses the [score.py file](https://github.com/Azure/azureml-examples/blob/main/cli/endpoints/online/model-1/onlinescoring/score.py).
386
+
As noted earlier, the script specified in`code_configuration.scoring_script` must have an `init()` function and a `run()` function.
387
387
388
388
# [Python](#tab/python)
389
-
As noted earlier, the script specified in`CodeConfiguration(scoring_script="score.py")` must have an `init()` function and a `run()` function. This example uses the [score.py file](https://github.com/Azure/azureml-examples/blob/main/sdk/python/endpoints/online/model-1/onlinescoring/score.py).
389
+
As noted earlier, the script specified in`CodeConfiguration(scoring_script="score.py")` must have an `init()` function and a `run()` function.
390
390
391
391
# [ARM template](#tab/arm)
392
392
@@ -404,6 +404,10 @@ When using a template for deployment, you must first upload the scoring file(s)
404
404
405
405
---
406
406
407
+
This example uses the [score.py file](https://github.com/Azure/azureml-examples/blob/main/sdk/python/endpoints/online/model-1/onlinescoring/score.py):
The `init()` function is called when the container is initialized or started. Initialization typically occurs shortly after the deployment is created or updated. Write logic here forglobal initialization operations like caching the model in memory (as we do in this example). The `run()` function is called for every invocation of the endpoint and should do the actual scoring and prediction. In the example, we extract the data from the JSONinput, call the scikit-learn model's `predict()` method, and then return the result.
408
412
409
413
## Deploy and debug locally by using local endpoints
0 commit comments