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
@@ -39,121 +39,119 @@ You can deploy managed compute models using the Azure Machine Learning SDK, but
39
39
40
40
## Deploy the model
41
41
42
-
Let's deploy the model.
43
-
44
-
First, you need to install the Azure Machine Learning SDK.
45
-
46
-
```python
47
-
pip install azure-ai-ml
48
-
pip install azure-identity
49
-
```
50
-
51
-
Use this code to authenticate with Azure Machine Learning and create a client object. Replace the placeholders with your subscription ID, resource group name, and Azure AI Foundry project name.
52
-
53
-
```python
54
-
from azure.ai.ml import MLClient
55
-
from azure.identity import InteractiveBrowserCredential
56
-
57
-
client = MLClient(
58
-
credential=InteractiveBrowserCredential,
59
-
subscription_id="your subscription name goes here",
60
-
resource_group_name="your resource group name goes here",
61
-
workspace_name="your project name goes here",
62
-
)
63
-
```
64
-
65
-
For the managed compute deployment option, you need to create an endpoint before a model deployment. Think of an endpoint as a container that can house multiple model deployments. The endpoint names need to be unique in a region, so in this example we're using the timestamp to create a unique endpoint name.
66
-
67
-
```python
68
-
import time, sys
69
-
from azure.ai.ml.entities import (
70
-
ManagedOnlineEndpoint,
71
-
ManagedOnlineDeployment,
72
-
ProbeSettings,
73
-
)
74
-
75
-
# Make the endpoint name unique
76
-
timestamp =int(time.time())
77
-
online_endpoint_name ="customize your endpoint name here"+str(timestamp)
1. Authenticate with Azure Machine Learning and create a client object. Replace the placeholders with your subscription ID, resource group name, and Azure AI Foundry project name.
50
+
51
+
```python
52
+
from azure.ai.ml import MLClient
53
+
from azure.identity import InteractiveBrowserCredential
54
+
55
+
workspace_ml_client = MLClient(
56
+
credential=InteractiveBrowserCredential,
57
+
subscription_id="your subscription name goes here",
58
+
resource_group_name="your resource group name goes here",
59
+
workspace_name="your project name goes here",
60
+
)
61
+
```
62
+
63
+
1. Create an endpoint. For the managed compute deployment option, you need to create an endpoint before a model deployment. Think of an endpoint as a container that can house multiple model deployments. The endpoint names need to be unique in a region, so in this example use the timestamp to create a unique endpoint name.
64
+
65
+
```python
66
+
import time, sys
67
+
from azure.ai.ml.entities import (
68
+
ManagedOnlineEndpoint,
69
+
ManagedOnlineDeployment,
70
+
ProbeSettings,
71
+
)
72
+
73
+
# Make the endpoint name unique
74
+
timestamp =int(time.time())
75
+
online_endpoint_name ="customize your endpoint name here"+str(timestamp)
1. Create a deployment. Replace the model IDin the next code with the model ID that you copied from the details page of the model you selected in the [Get the model ID](#get-the-model-id) section.
You need a sample json data to test inferencing. Create `sample_score.json` with the following example.
121
-
122
-
```python
123
-
{
124
-
"inputs": {
125
-
"question": [
126
-
"Where do I live?",
127
-
"Where do I live?",
128
-
"What's my name?",
129
-
"Which name is also used to describe the Amazon rainforest in English?"
130
-
],
131
-
"context": [
132
-
"My name is Wolfgang and I live in Berlin",
133
-
"My name is Sarah and I live in London",
134
-
"My name is Clara and I live in Berkeley.",
135
-
"The Amazon rainforest (Portuguese: Floresta Amaz\u00f4nica or Amaz\u00f4nia; Spanish: Selva Amaz\u00f3nica, Amazon\u00eda or usually Amazonia; French: For\u00eat amazonienne; Dutch: Amazoneregenwoud), also known in English as Amazonia or the Amazon Jungle, is a moist broadleaf forest that covers most of the Amazon basin of South America. This basin encompasses 7,000,000 square kilometres (2,700,000 sq mi), of which 5,500,000 square kilometres (2,100,000 sq mi) are covered by the rainforest. This region includes territory belonging to nine nations. The majority of the forest is contained within Brazil, with 60% of the rainforest, followed by Peru with 13%, Colombia with 10%, and with minor amounts in Venezuela, Ecuador, Bolivia, Guyana, Suriname and French Guiana. States or departments in four nations contain \"Amazonas\" in their names. The Amazon represents over half of the planet's remaining rainforests, and comprises the largest and most biodiverse tract of tropical rainforest in the world, with an estimated 390 billion individual trees divided into 16,000 species."
136
-
]
137
-
}
138
-
}
139
-
```
140
-
141
-
Let's inference with `sample_score.json`. Change the location based on where you saved your sample json file.
1. You need a sample json data to test inferencing. Create `sample_score.json`with the following example.
119
+
120
+
```python
121
+
{
122
+
"inputs": {
123
+
"question": [
124
+
"Where do I live?",
125
+
"Where do I live?",
126
+
"What's my name?",
127
+
"Which name is also used to describe the Amazon rainforest in English?"
128
+
],
129
+
"context": [
130
+
"My name is Wolfgang and I live in Berlin",
131
+
"My name is Sarah and I live in London",
132
+
"My name is Clara and I live in Berkeley.",
133
+
"The Amazon rainforest (Portuguese: Floresta Amaz\u00f4nica or Amaz\u00f4nia; Spanish: Selva Amaz\u00f3nica, Amazon\u00eda or usually Amazonia; French: For\u00eat amazonienne; Dutch: Amazoneregenwoud), also known in English as Amazonia or the Amazon Jungle, is a moist broadleaf forest that covers most of the Amazon basin of South America. This basin encompasses 7,000,000 square kilometres (2,700,000 sq mi), of which 5,500,000 square kilometres (2,100,000 sq mi) are covered by the rainforest. This region includes territory belonging to nine nations. The majority of the forest is contained within Brazil, with 60% of the rainforest, followed by Peru with 13%, Colombia with 10%, and with minor amounts in Venezuela, Ecuador, Bolivia, Guyana, Suriname and French Guiana. States or departments in four nations contain \"Amazonas\" in their names. The Amazon represents over half of the planet's remaining rainforests, and comprises the largest and most biodiverse tract of tropical rainforest in the world, with an estimated 390 billion individual trees divided into 16,000 species."
134
+
]
135
+
}
136
+
}
137
+
```
138
+
139
+
1. Inference with`sample_score.json`. Change the location of the scoring filein the next code, based on where you saved your sample json file.
To configure autoscaling for deployments, you can go to Azure Portal, locate the Azure resource typed `Machine learning online deployment` in the resource group of the AI project, and use Scaling menu under Setting. For more information on autoscaling, see [Autoscale online endpoints](/azure/machine-learning/how-to-autoscale-endpoints) in the Azure Machine Learning documentation.
154
+
To configure autoscaling for deployments, you can go to Azure portal, locate the Azure resource typed `Machine learning online deployment`in the resource group of the AI project, and use Scaling menu under Setting. For more information on autoscaling, see [Autoscale online endpoints](/azure/machine-learning/how-to-autoscale-endpoints) in the Azure Machine Learning documentation.
157
155
158
156
## Delete the deployment endpoint
159
157
@@ -163,7 +161,7 @@ To delete deployments in Azure AI Foundry portal, select the **Delete** button o
163
161
164
162
To deploy and perform inferencing with real-time endpoints, you consume Virtual Machine (VM) core quota that is assigned to your subscription on a per-region basis. When you sign up for Azure AI Foundry, you receive a default VM quota for several VM families available in the region. You can continue to create deployments until you reach your quota limit. Once that happens, you can request for a quota increase.
165
163
166
-
## Next steps
164
+
## Related content
167
165
168
166
- Learn more about what you can do in [Azure AI Foundry](../what-is-ai-foundry.md)
169
167
- Get answers to frequently asked questions in the [Azure AIFAQ article](../faq.yml)
0 commit comments