-
Notifications
You must be signed in to change notification settings - Fork 60
Adding inference container URI for edit model handler #1030
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
Adding inference container URI for edit model handler #1030
Conversation
ads/aqua/extension/model_handler.py
Outdated
| if ( | ||
| inference_container is not None | ||
| and inference_container not in inference_containers | ||
| and inference_container |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To avoid hardcoding, would it be better to move AQUA_TEI_CONTAINER_FAMILY from InferenceContainerTypeFamily to a new enum CustomInferenceContainerTypeFamily(str, metaclass=ExtendedEnumMeta)? That way the final inference_containers list can be inference_containers.append(CustomInferenceContainerTypeFamily.values()).
ads/aqua/model/model.py
Outdated
| replace=True, | ||
| ) | ||
| if ( | ||
| inference_container |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this can be replaced with inference_container in CustomInferenceContainerTypeFamily.values()
ads/aqua/model/model.py
Outdated
| ) | ||
| else: | ||
| raise AquaRuntimeError( | ||
| f"Failed to edit model:{id}. Inference container URI can be edited only with TEI container." |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
f"Inference container URI can be edited only with container values: {CustomInferenceContainerTypeFamily.values()}".
|
|
||
| inference_container = input_data.get("inference_container") | ||
| inference_container_uri = input_data.get("inference_container_uri") | ||
| inference_containers = AquaModelApp.list_valid_inference_containers() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will it always return a list?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes , either an empty list or list of valid containers from container_index.json stored in OSS bucket
ads/aqua/model/model.py
Outdated
| f"Failed to delete model:{model_id}. Only registered models or finetuned model can be deleted." | ||
| ) | ||
|
|
||
| @telemetry(entry_point="plugin=model&action=delete", name="aqua") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why in telemetry we say delete?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated. Thanks
| inference_container: str. | ||
| The inference container family name | ||
| inference_container_uri: str | ||
| The inference container uri for embedding models |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
s it only for embedding models?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes as per now , we accept inference container URI for embedding models only
ads/aqua/model/model.py
Outdated
| ) | ||
| if ( | ||
| inference_container | ||
| in CustomInferenceContainerTypeFamily.values() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ExtendedEnumMeta implement the __contains__ method, that means we can do something like this:
inference_container in CustomInferenceContainerTypeFamily
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated
| "Inference container URI must be provided." | ||
| ) | ||
| else: | ||
| custom_metadata_list.add( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we really need to store this info in metadata? Can't it be extracted from MD?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This metadata contains deployment container. Via edit feature , user can edit/change deployment container as well. Hence , adding updated container to metadata.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
However user can update deployment from console, and in this case the container stored on the model level will not match a real one?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes but source of truth here should be model right , not the model deployment.
User can create multiple model deployments from a single model. What we are trying to do here is changing/updating the model config.
What if user registered a model for a particular deployment container. Now , they due to some reason want to change the deployment container config of the model.
This PR intends to update EDIT model handler for editing registered model config in AQUA.
The edit feature is available for registered unverified model.
This will allow user to edit the following config for models in AQUA after the model is registered: