@@ -578,9 +578,9 @@ deployment_client.predict(endpoint=endpoint_name, df=samples)
578
578
579
579
MLflow models can use the __Test__ tab to create invocations to the created endpoints:
580
580
581
- 1 . Go to the __Endpoints__ tab and select the endpoint you created.
581
+ 1 . Select __Endpoints__, and then select the endpoint that you created.
582
582
1 . Go to the __Test__ tab.
583
- 1 . Paste the content of the file ` sample- request- sklearn.json` .
583
+ 1 . In the __Input__ box, paste the contents of the cli / endpoints / online / ncd / sample- request- sklearn.json file .
584
584
1 . Select __Test__.
585
585
1 . The box on the right displays the predictions.
586
586
@@ -651,7 +651,7 @@ To deploy an MLflow model with a custom scoring script:
651
651
652
652
```pythonS
653
653
environment = Environment(
654
- conda_file = " sklearn-diabetes/environment/conda.yml " ,
654
+ conda_file = " sklearn-diabetes/environment/conda.yaml " ,
655
655
image = " mcr.microsoft.com/azureml/openmpi4.1.0-ubuntu22.04:latest" ,
656
656
)
657
657
```
@@ -715,6 +715,9 @@ To deploy an MLflow model with a custom scoring script:
715
715
instance_type = " Standard_F4s_v2" ,
716
716
instance_count = 1 ,
717
717
)
718
+
719
+ ml_client.online_deployments.begin_create_or_update(blue_deployment)
720
+
718
721
```
719
722
720
723
# [Python (MLflow SDK)](#tab/mlflow)
@@ -745,8 +748,24 @@ To deploy an MLflow model with a custom scoring script:
745
748
746
749
1 . When your deployment is complete, it' s ready to serve requests. One way to test the deployment is to use the `invoke` method with a sample request file such as the following file, sample-request-sklearn.json:
747
750
751
+ # [Azure CLI](#tab/cli)
752
+
753
+ :::code language = " json" source = " ~/azureml-examples-main/cli/endpoints/online/ncd/sample-request-sklearn.json" :::
754
+
755
+ # [Python (Azure Machine Learning SDK)](#tab/sdk)
756
+
757
+ :::code language = " json" source = " ~/azureml-examples-main/sdk/python/endpoints/online/mlflow/sample-request-sklearn.json" :::
758
+
759
+ # [Python (MLflow SDK)](#tab/mlflow)
760
+
761
+ This operation isn' t supported in the MLflow SDK.
762
+
763
+ # [Studio](#tab/studio)
764
+
748
765
:::code language = " json" source = " ~/azureml-examples-main/cli/endpoints/online/ncd/sample-request-sklearn.json" :::
749
766
767
+ -- -
768
+
750
769
Submit a request to the endpoint:
751
770
752
771
# [Azure CLI](#tab/cli)
@@ -756,7 +775,7 @@ To deploy an MLflow model with a custom scoring script:
756
775
# [Python (Azure Machine Learning SDK)](#tab/sdk)
757
776
758
777
```python
759
- ml_client.online_endpoints.invoke(
778
+ response = ml_client.online_endpoints.invoke(
760
779
endpoint_name = endpoint_name,
761
780
deployment_name = deployment.name,
762
781
request_file = " sample-request-sklearn.json" ,
@@ -769,25 +788,54 @@ To deploy an MLflow model with a custom scoring script:
769
788
770
789
# [Studio](#tab/studio)
771
790
772
- 1 . Go to the __Endpoints__ tab and select the endpoint that you created.
791
+ 1 . Select __Endpoints__, and then select the endpoint that you created.
773
792
1 . Go to the __Test__ tab.
774
- 1 . Paste the contents of the ` sample- request- sklearn.json` file into the __Input data to test endpoint__ box .
793
+ 1 . In the __Input__ box, paste the contents of the cli / endpoints / online / ncd / sample- request- sklearn.json file .
775
794
1 . Select __Test__.
776
- 1 . The predictions are displayed under " Test results " on the right side of the box .
795
+ 1 . The box on the right displays the predictions .
777
796
778
797
-- -
779
798
780
799
The response should be similar to the following text:
781
800
801
+ # [Azure CLI](#tab/cli)
802
+
803
+ ```json
804
+ {
805
+ " predictions" : [
806
+ 1095.2797413413252 ,
807
+ 1134.585328803727
808
+ ]
809
+ }
810
+ ```
811
+
812
+ # [Python (Azure Machine Learning SDK)](#tab/sdk)
813
+
814
+ ```json
815
+ {
816
+ " predictions" : [
817
+ 1095.2797413413252
818
+ ]
819
+ }
820
+ ```
821
+
822
+ # [Python (MLflow SDK)](#tab/mlflow)
823
+
824
+ This operation isn' t supported in the MLflow SDK.
825
+
826
+ # [Studio](#tab/studio)
827
+
782
828
```json
783
829
{
784
830
" predictions" : [
785
- 11633.100167144921 ,
786
- 8522.117402884991
831
+ 1095.2797413413252 ,
832
+ 1134.585328803727
787
833
]
788
834
}
789
835
```
790
836
837
+ -- -
838
+
791
839
> [! WARNING ]
792
840
> __MLflow 2.0 advisory__: In MLflow 1. X, the response doesn' t contain the `predictions` key.
793
841
0 commit comments