Skip to content

Commit

Permalink
support label in model deploy
Browse files Browse the repository at this point in the history
  • Loading branch information
pitt-liang committed Apr 25, 2024
1 parent d8e2333 commit d77859e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
5 changes: 4 additions & 1 deletion pai/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -832,6 +832,7 @@ def deploy(
options=options,
wait=wait,
serializer=serializer,
**kwargs,
)

def _generate_service_name(self):
Expand All @@ -849,6 +850,7 @@ def _deploy(
options: Dict[str, Any] = None,
wait: bool = True,
serializer: "SerializerBase" = None,
labels: Optional[Dict[str, str]] = None,
):
"""Create a prediction service."""
if not service_name:
Expand All @@ -867,7 +869,7 @@ def _deploy(
resource_id=resource_id,
options=options,
)
service_name = self.session.service_api.create(config=config)
service_name = self.session.service_api.create(config=config, labels=labels)
self._wait_service_visible(service_name)
if service_type == ServiceType.Async:
predictor = AsyncPredictor(
Expand Down Expand Up @@ -1738,6 +1740,7 @@ def deploy(
options=options,
wait=wait,
serializer=serializer,
**kwargs,
)

def _build_service_config(
Expand Down
1 change: 1 addition & 0 deletions pai/modelscope/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -350,4 +350,5 @@ def deploy(
options=options,
wait=wait,
serializer=serializer,
**kwargs,
)

0 comments on commit d77859e

Please sign in to comment.