-
Notifications
You must be signed in to change notification settings - Fork 348
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
feat: support model monitoring for batch prediction in Vertex SDK #1570
Changes from all commits
4a12af8
f647786
cf1e03b
f35f160
c6be116
9b4f25e
9047f10
aa680b3
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,9 +17,16 @@ | |
|
||
from typing import Optional, List | ||
from google.cloud.aiplatform_v1.types import ( | ||
model_monitoring as gca_model_monitoring, | ||
model_monitoring as gca_model_monitoring_v1, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should we use There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
) | ||
|
||
# TODO: remove imports from v1beta1 once model monitoring for batch prediction is GA | ||
from google.cloud.aiplatform_v1beta1.types import ( | ||
model_monitoring as gca_model_monitoring_v1beta1, | ||
) | ||
|
||
gca_model_monitoring = gca_model_monitoring_v1 | ||
|
||
|
||
class EmailAlertConfig: | ||
def __init__( | ||
|
@@ -40,8 +47,19 @@ def __init__( | |
self.enable_logging = enable_logging | ||
self.user_emails = user_emails | ||
|
||
def as_proto(self): | ||
"""Returns EmailAlertConfig as a proto message.""" | ||
# TODO: remove config_for_bp parameter when model monitoring for batch prediction is GA | ||
def as_proto(self, config_for_bp: bool = False): | ||
"""Returns EmailAlertConfig as a proto message. | ||
|
||
Args: | ||
config_for_bp (bool): | ||
Optional. Set this parameter to True if the config object | ||
is used for model monitoring on a batch prediction job. | ||
""" | ||
if config_for_bp: | ||
gca_model_monitoring = gca_model_monitoring_v1beta1 | ||
else: | ||
gca_model_monitoring = gca_model_monitoring_v1 | ||
user_email_alert_config = ( | ||
gca_model_monitoring.ModelMonitoringAlertConfig.EmailAlertConfig( | ||
user_emails=self.user_emails | ||
|
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.
Are these docstrings copied from the source at https://github.com/googleapis/googleapis/tree/master/google/cloud/aiplatform? Will we be able to remember to update this when/if alerts other than email alert become supported?
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.
They're not directly copied from GAPIC. But Jing's team also confirmed that there's no plans for additional alert configs.