Skip to content

[WIP] Use custom model name in deployment #1236

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions ads/aqua/model/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,7 @@ def create(
compartment_id: Optional[str] = None,
freeform_tags: Optional[Dict] = None,
defined_tags: Optional[Dict] = None,
display_name: Optional[str] = None,
**kwargs,
) -> DataScienceModel:
"""
Expand All @@ -169,6 +170,8 @@ def create(
Freeform tags for the model.
defined_tags : Optional[Dict]
Defined tags for the model.
display_name: ptional[str]
The display name of the custom model.

Returns
-------
Expand Down Expand Up @@ -204,6 +207,9 @@ def create(
**(defined_tags or {}),
}

if display_name:
service_model.display_name = display_name

custom_model = (
DataScienceModel()
.with_compartment_id(target_compartment)
Expand Down
3 changes: 2 additions & 1 deletion ads/aqua/modeldeployment/deployment.py
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,7 @@ def create(
)
aqua_model = model_app.create(
model_id=create_deployment_details.model_id,
display_name=create_deployment_details.model_name,
compartment_id=compartment_id,
project_id=project_id,
freeform_tags=freeform_tags,
Expand Down Expand Up @@ -446,6 +447,7 @@ def _create(
cmd_var_string = aqua_model.custom_metadata_list.get(
AQUA_DEPLOYMENT_CONTAINER_CMD_VAR_METADATA_NAME
).value

default_cmd_var = shlex.split(cmd_var_string)
if default_cmd_var:
cmd_var = validate_cmd_var(default_cmd_var, cmd_var)
Expand Down Expand Up @@ -538,7 +540,6 @@ def _create(
)

deployment_params = get_combined_params(config_params, user_params)

params = f"{params} {deployment_params}".strip()
if params:
env_var.update({"PARAMS": params})
Expand Down
3 changes: 3 additions & 0 deletions ads/aqua/modeldeployment/entities.py
Original file line number Diff line number Diff line change
Expand Up @@ -233,6 +233,9 @@ class CreateModelDeploymentDetails(BaseModel):
None, description="The description of the deployment."
)
model_id: Optional[str] = Field(None, description="The model OCID to deploy.")
model_name: Optional[str] = Field(
None, description="The model name specified by user to deploy."
)
models: Optional[List[AquaMultiModelRef]] = Field(
None, description="List of models for multimodel deployment."
)
Expand Down
Loading