Skip to content

Commit

Permalink
Notebook for text to image for ds-mii model (#2873)
Browse files Browse the repository at this point in the history
* Notebook for text to image for ds-mii model

* aacs

* cli

* cli

* model name

* code quality

---------

Co-authored-by: grajguru <[email protected]>
  • Loading branch information
gauravrajguru and grajguru authored Dec 22, 2023
1 parent 7f9a32a commit 342e602
Show file tree
Hide file tree
Showing 5 changed files with 122 additions and 824 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,5 @@ liveness_probe:
timeout: 299
request_settings:
request_timeout_ms: 90000

environment_variables:
"WORKER_COUNT": 2
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ az account set -s $subscription_id
workspace_info="--resource-group $resource_group_name --workspace-name $workspace_name"

# 2. Check if the model exists in the registry
# Need to confirm model show command works for registries outside the tenant (aka system registry)
if ! az ml model show --name $model_name --label $model_label --registry-name $registry_name
then
echo "Model $model_name:$model_label does not exist in registry $registry_name"
Expand All @@ -44,13 +43,22 @@ model_version=$(az ml model show --name $model_name --label $model_label --regis

# 3. Deploy the model to an endpoint
# Create online endpoint
az ml online-endpoint create --name $endpoint_name $workspace_info || {
az ml online-endpoint create --name $endpoint_name $workspace_info || {
echo "endpoint create failed"; exit 1;
}

# 3.1 Setup Deployment Parameters
max_concurrent_request=2 # the maximum number of concurrent requests supported by the endpoint

# Note: We have set the value of `max_concurrent_request` to 2,
# as we are utilizing the `Standard_NC6s_v3` SKU for deployment, which has one GPU.
# If you are using a larger SKU, please increase this value to get the maximum performance.

# Deploy model from registry to endpoint in workspace
az ml online-deployment create --file deploy-online.yaml $workspace_info --all-traffic --set \
endpoint_name=$endpoint_name model=azureml://registries/$registry_name/models/$model_name/versions/$model_version \
request_settings.max_concurrent_requests_per_instance=$max_concurrent_request \
environment_variables.WORKER_COUNT=$max_concurrent_request \
instance_type=$deployment_sku || {
echo "deployment create failed"; exit 1;
}
Expand Down
Loading

0 comments on commit 342e602

Please sign in to comment.