Skip to content

Commit

Permalink
Fix batch deployment update bug (#37492)
Browse files Browse the repository at this point in the history
* fix batch deployment update bug

* fix test
  • Loading branch information
PratibhaShrivastav18 authored Oct 7, 2024
1 parent 76b5a9f commit 28ad1af
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ def __init__(
self.compute = compute
self.resources = resources
if settings is not None:
self.model_deployment_settings = ModelBatchDeploymentSettings(
self.settings = ModelBatchDeploymentSettings(
mini_batch_size=settings.mini_batch_size,
instance_count=settings.instance_count,
max_concurrency_per_instance=settings.max_concurrency_per_instance,
Expand Down Expand Up @@ -113,7 +113,7 @@ def _to_rest_object(self, location: str) -> BatchDeploymentData: # type: ignore
if self.code_configuration
else None
)
deployment_settings = self.model_deployment_settings
deployment_settings = self.settings
model = IdAssetReference(asset_id=self.model) if self.model else None
batch_deployment = RestBatchDeployment(
description=self.description,
Expand Down Expand Up @@ -188,9 +188,9 @@ def _validate(self) -> None:

def _validate_output_action(self) -> None:
if (
self.model_deployment_settings.output_action
and self.model_deployment_settings.output_action == BatchDeploymentOutputAction.SUMMARY_ONLY
and self.model_deployment_settings.output_file_name
self.settings.output_action
and self.settings.output_action == BatchDeploymentOutputAction.SUMMARY_ONLY
and self.settings.output_file_name
):
msg = "When output_action is set to {}, the output_file_name need not to be specified."
msg = msg.format(BatchDeploymentOutputAction.SUMMARY_ONLY)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@ def test_serialize_model_batch_deployment(self) -> None:
assert mbd_entity
assert mbd_entity.environment == "AzureML-sklearn-1.0-ubuntu20.04-py38-cpu:33"
assert mbd_entity.compute == "cpu-cluster"
assert mbd_entity.model_deployment_settings.output_action == BatchDeploymentOutputAction.APPEND_ROW
assert mbd_entity.model_deployment_settings.output_file_name == "append_row.txt"
assert mbd_entity.model_deployment_settings.error_threshold == 10
assert mbd_entity.model_deployment_settings.mini_batch_size == 5
assert mbd_entity.model_deployment_settings.max_concurrency_per_instance == 5
assert mbd_entity.settings.output_action == BatchDeploymentOutputAction.APPEND_ROW
assert mbd_entity.settings.output_file_name == "append_row.txt"
assert mbd_entity.settings.error_threshold == 10
assert mbd_entity.settings.mini_batch_size == 5
assert mbd_entity.settings.max_concurrency_per_instance == 5
assert mbd_entity.resources.instance_count == 2

0 comments on commit 28ad1af

Please sign in to comment.