Skip to content
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: Removes AcceleratorType.TPU_V2 and TPU_V3 constants #543

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Expand Up @@ -26,8 +26,8 @@ class ImageClassificationPredictionInstance(proto.Message):
r"""Prediction input format for Image Classification.
Attributes:
content (str):
The image bytes or GCS URI to make the
prediction on.
The image bytes or Cloud Storage URI to make
the prediction on.
mime_type (str):
The MIME type of the content of the image.
Only the images in below listed MIME types are
Expand Down
Expand Up @@ -26,8 +26,8 @@ class ImageObjectDetectionPredictionInstance(proto.Message):
r"""Prediction input format for Image Object Detection.
Attributes:
content (str):
The image bytes or GCS URI to make the
prediction on.
The image bytes or Cloud Storage URI to make
the prediction on.
mime_type (str):
The MIME type of the content of the image.
Only the images in below listed MIME types are
Expand Down
Expand Up @@ -36,7 +36,7 @@ class TextExtractionPredictionInstance(proto.Message):
If a key is provided, the batch prediction
result will by mapped to this key. If omitted,
then the batch prediction result will contain
the entire input instance. AI Platform will not
the entire input instance. Vertex AI will not
check if keys in the request are duplicates, so
it is up to the caller to ensure the keys are
unique.
Expand Down
Expand Up @@ -37,16 +37,16 @@ class VideoClassificationPredictionParams(proto.Message):
10,000.
segment_classification (bool):
Set to true to request segment-level
classification. AI Platform returns labels and
classification. Vertex AI returns labels and
their confidence scores for the entire time
segment of the video that user specified in the
input instance. Default value is true
shot_classification (bool):
Set to true to request shot-level
classification. AI Platform determines the
classification. Vertex AI determines the
boundaries for each camera shot in the entire
time segment of the video that user specified in
the input instance. AI Platform then returns
the input instance. Vertex AI then returns
labels and their confidence scores for each
detected shot, along with the start and end time
of the shot.
Expand All @@ -57,15 +57,14 @@ class VideoClassificationPredictionParams(proto.Message):
Default value is false
one_sec_interval_classification (bool):
Set to true to request classification for a
video at one-second intervals. AI Platform
returns labels and their confidence scores for
each second of the entire time segment of the
video that user specified in the input WARNING:
Model evaluation is not done for this
classification type, the quality of it depends
on the training data, but there are no metrics
provided to describe that quality. Default value
is false
video at one-second intervals. Vertex AI returns
labels and their confidence scores for each
second of the entire time segment of the video
that user specified in the input WARNING: Model
evaluation is not done for this classification
type, the quality of it depends on the training
data, but there are no metrics provided to
describe that quality. Default value is false
"""

confidence_threshold = proto.Field(proto.FLOAT, number=1,)
Expand Down
Expand Up @@ -27,8 +27,7 @@ class ClassificationPredictionResult(proto.Message):
Attributes:
ids (Sequence[int]):
The resource IDs of the AnnotationSpecs that
had been identified, ordered by the confidence
score descendingly.
had been identified.
display_names (Sequence[str]):
The display names of the AnnotationSpecs that
had been identified, order matches the IDs.
Expand Down
Expand Up @@ -139,6 +139,9 @@ class AutoMlTablesInputs(proto.Message):
predictions to a BigQuery table. If this
configuration is absent, then the export is not
performed.
additional_experiments (Sequence[str]):
Additional experiment flags for the Tables
training pipeline.
"""

class Transformation(proto.Message):
Expand Down Expand Up @@ -401,6 +404,7 @@ class TextArrayTransformation(proto.Message):
number=10,
message=gcastd_export_evaluated_data_items_config.ExportEvaluatedDataItemsConfig,
)
additional_experiments = proto.RepeatedField(proto.STRING, number=11,)


class AutoMlTablesMetadata(proto.Message):
Expand Down
Expand Up @@ -48,6 +48,8 @@ class ModelType(proto.Enum):
MODEL_TYPE_UNSPECIFIED = 0
CLOUD = 1
MOBILE_VERSATILE_1 = 2
MOBILE_JETSON_VERSATILE_1 = 3
MOBILE_CORAL_VERSATILE_1 = 4

model_type = proto.Field(proto.ENUM, number=1, enum=ModelType,)

Expand Down
Expand Up @@ -33,7 +33,6 @@ class ExportEvaluatedDataItemsConfig(proto.Message):

If not specified, then results are exported to the following
auto-created BigQuery table:

<project_id>:export_evaluated_examples_<model_name>_<yyyy_MM_dd'T'HH_mm_ss_SSS'Z'>.evaluated_examples
override_existing_table (bool):
If true and an export destination is
Expand Down
30 changes: 30 additions & 0 deletions google/cloud/aiplatform_v1/__init__.py
Expand Up @@ -34,8 +34,10 @@
from .types.accelerator_type import AcceleratorType
from .types.annotation import Annotation
from .types.annotation_spec import AnnotationSpec
from .types.artifact import Artifact
from .types.batch_prediction_job import BatchPredictionJob
from .types.completion_stats import CompletionStats
from .types.context import Context
from .types.custom_job import ContainerSpec
from .types.custom_job import CustomJob
from .types.custom_job import CustomJobSpec
Expand Down Expand Up @@ -86,6 +88,7 @@
from .types.endpoint_service import UndeployModelResponse
from .types.endpoint_service import UpdateEndpointRequest
from .types.env_var import EnvVar
from .types.execution import Execution
from .types.hyperparameter_tuning_job import HyperparameterTuningJob
from .types.io import BigQueryDestination
from .types.io import BigQuerySource
Expand Down Expand Up @@ -118,6 +121,7 @@
from .types.job_service import ListHyperparameterTuningJobsResponse
from .types.job_state import JobState
from .types.machine_resources import AutomaticResources
from .types.machine_resources import AutoscalingMetricSpec
from .types.machine_resources import BatchDedicatedResources
from .types.machine_resources import DedicatedResources
from .types.machine_resources import DiskSpec
Expand Down Expand Up @@ -157,10 +161,20 @@
from .types.model_service import UploadModelResponse
from .types.operation import DeleteOperationMetadata
from .types.operation import GenericOperationMetadata
from .types.pipeline_job import PipelineJob
from .types.pipeline_job import PipelineJobDetail
from .types.pipeline_job import PipelineTaskDetail
from .types.pipeline_job import PipelineTaskExecutorDetail
from .types.pipeline_service import CancelPipelineJobRequest
from .types.pipeline_service import CancelTrainingPipelineRequest
from .types.pipeline_service import CreatePipelineJobRequest
from .types.pipeline_service import CreateTrainingPipelineRequest
from .types.pipeline_service import DeletePipelineJobRequest
from .types.pipeline_service import DeleteTrainingPipelineRequest
from .types.pipeline_service import GetPipelineJobRequest
from .types.pipeline_service import GetTrainingPipelineRequest
from .types.pipeline_service import ListPipelineJobsRequest
from .types.pipeline_service import ListPipelineJobsResponse
from .types.pipeline_service import ListTrainingPipelinesRequest
from .types.pipeline_service import ListTrainingPipelinesResponse
from .types.pipeline_state import PipelineState
Expand All @@ -185,6 +199,7 @@
from .types.training_pipeline import TimestampSplit
from .types.training_pipeline import TrainingPipeline
from .types.user_action_reference import UserActionReference
from .types.value import Value

__all__ = (
"DatasetServiceAsyncClient",
Expand All @@ -199,7 +214,9 @@
"ActiveLearningConfig",
"Annotation",
"AnnotationSpec",
"Artifact",
"AutomaticResources",
"AutoscalingMetricSpec",
"BatchDedicatedResources",
"BatchMigrateResourcesOperationMetadata",
"BatchMigrateResourcesRequest",
Expand All @@ -211,10 +228,12 @@
"CancelCustomJobRequest",
"CancelDataLabelingJobRequest",
"CancelHyperparameterTuningJobRequest",
"CancelPipelineJobRequest",
"CancelTrainingPipelineRequest",
"CompletionStats",
"ContainerRegistryDestination",
"ContainerSpec",
"Context",
"CreateBatchPredictionJobRequest",
"CreateCustomJobRequest",
"CreateDataLabelingJobRequest",
Expand All @@ -223,6 +242,7 @@
"CreateEndpointOperationMetadata",
"CreateEndpointRequest",
"CreateHyperparameterTuningJobRequest",
"CreatePipelineJobRequest",
"CreateSpecialistPoolOperationMetadata",
"CreateSpecialistPoolRequest",
"CreateTrainingPipelineRequest",
Expand All @@ -241,6 +261,7 @@
"DeleteHyperparameterTuningJobRequest",
"DeleteModelRequest",
"DeleteOperationMetadata",
"DeletePipelineJobRequest",
"DeleteSpecialistPoolRequest",
"DeleteTrainingPipelineRequest",
"DeployModelOperationMetadata",
Expand All @@ -253,6 +274,7 @@
"Endpoint",
"EndpointServiceClient",
"EnvVar",
"Execution",
"ExportDataConfig",
"ExportDataOperationMetadata",
"ExportDataRequest",
Expand All @@ -275,6 +297,7 @@
"GetModelEvaluationRequest",
"GetModelEvaluationSliceRequest",
"GetModelRequest",
"GetPipelineJobRequest",
"GetSpecialistPoolRequest",
"GetTrainingPipelineRequest",
"HyperparameterTuningJob",
Expand Down Expand Up @@ -307,6 +330,8 @@
"ListModelEvaluationsResponse",
"ListModelsRequest",
"ListModelsResponse",
"ListPipelineJobsRequest",
"ListPipelineJobsResponse",
"ListSpecialistPoolsRequest",
"ListSpecialistPoolsResponse",
"ListTrainingPipelinesRequest",
Expand All @@ -323,8 +348,12 @@
"ModelEvaluation",
"ModelEvaluationSlice",
"ModelServiceClient",
"PipelineJob",
"PipelineJobDetail",
"PipelineServiceClient",
"PipelineState",
"PipelineTaskDetail",
"PipelineTaskExecutorDetail",
"Port",
"PredefinedSplit",
"PredictRequest",
Expand Down Expand Up @@ -356,5 +385,6 @@
"UploadModelRequest",
"UploadModelResponse",
"UserActionReference",
"Value",
"WorkerPoolSpec",
)
50 changes: 50 additions & 0 deletions google/cloud/aiplatform_v1/gapic_metadata.json
Expand Up @@ -570,26 +570,51 @@
"grpc": {
"libraryClient": "PipelineServiceClient",
"rpcs": {
"CancelPipelineJob": {
"methods": [
"cancel_pipeline_job"
]
},
"CancelTrainingPipeline": {
"methods": [
"cancel_training_pipeline"
]
},
"CreatePipelineJob": {
"methods": [
"create_pipeline_job"
]
},
"CreateTrainingPipeline": {
"methods": [
"create_training_pipeline"
]
},
"DeletePipelineJob": {
"methods": [
"delete_pipeline_job"
]
},
"DeleteTrainingPipeline": {
"methods": [
"delete_training_pipeline"
]
},
"GetPipelineJob": {
"methods": [
"get_pipeline_job"
]
},
"GetTrainingPipeline": {
"methods": [
"get_training_pipeline"
]
},
"ListPipelineJobs": {
"methods": [
"list_pipeline_jobs"
]
},
"ListTrainingPipelines": {
"methods": [
"list_training_pipelines"
Expand All @@ -600,26 +625,51 @@
"grpc-async": {
"libraryClient": "PipelineServiceAsyncClient",
"rpcs": {
"CancelPipelineJob": {
"methods": [
"cancel_pipeline_job"
]
},
"CancelTrainingPipeline": {
"methods": [
"cancel_training_pipeline"
]
},
"CreatePipelineJob": {
"methods": [
"create_pipeline_job"
]
},
"CreateTrainingPipeline": {
"methods": [
"create_training_pipeline"
]
},
"DeletePipelineJob": {
"methods": [
"delete_pipeline_job"
]
},
"DeleteTrainingPipeline": {
"methods": [
"delete_training_pipeline"
]
},
"GetPipelineJob": {
"methods": [
"get_pipeline_job"
]
},
"GetTrainingPipeline": {
"methods": [
"get_training_pipeline"
]
},
"ListPipelineJobs": {
"methods": [
"list_pipeline_jobs"
]
},
"ListTrainingPipelines": {
"methods": [
"list_training_pipelines"
Expand Down
Expand Up @@ -87,6 +87,8 @@ class JobServiceAsyncClient:
)
model_path = staticmethod(JobServiceClient.model_path)
parse_model_path = staticmethod(JobServiceClient.parse_model_path)
network_path = staticmethod(JobServiceClient.network_path)
parse_network_path = staticmethod(JobServiceClient.parse_network_path)
trial_path = staticmethod(JobServiceClient.trial_path)
parse_trial_path = staticmethod(JobServiceClient.parse_trial_path)
common_billing_account_path = staticmethod(
Expand Down
15 changes: 15 additions & 0 deletions google/cloud/aiplatform_v1/services/job_service/client.py
Expand Up @@ -285,6 +285,21 @@ def parse_model_path(path: str) -> Dict[str, str]:
)
return m.groupdict() if m else {}

@staticmethod
def network_path(project: str, network: str,) -> str:
"""Returns a fully-qualified network string."""
return "projects/{project}/global/networks/{network}".format(
project=project, network=network,
)

@staticmethod
def parse_network_path(path: str) -> Dict[str, str]:
"""Parses a network path into its component segments."""
m = re.match(
r"^projects/(?P<project>.+?)/global/networks/(?P<network>.+?)$", path
)
return m.groupdict() if m else {}

@staticmethod
def trial_path(project: str, location: str, study: str, trial: str,) -> str:
"""Returns a fully-qualified trial string."""
Expand Down