Skip to content

Commit 6af42e1

Browse files
committed
Google Cloud - Vertex_AI - Models - Upload_Tensorflow_model component - Simplified the component after my Vertex SDK fixes were merged
Some of my Vertex SDK fixes: googleapis/python-aiplatform#779 googleapis/python-aiplatform#882 googleapis/python-aiplatform#943 googleapis/python-aiplatform#997
1 parent 8016f51 commit 6af42e1

File tree

2 files changed

+12
-14
lines changed

2 files changed

+12
-14
lines changed

components/google-cloud/Vertex_AI/Models/Upload_Tensorflow_model/component.py

+4-5
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@
55

66
def upload_Tensorflow_model_to_Google_Cloud_Vertex_AI(
77
model_path: InputPath("TensorflowSavedModel"),
8-
tensorflow_version: str = "2.7", # TODO: Remove the explicit default once the upload_tensorflow_saved_model supports None
8+
tensorflow_version: str = None,
99
use_gpu: bool = False,
1010

11-
display_name: str = "Tensorflow model",
11+
display_name: str = None,
1212
description: str = None,
1313

1414
# Uncomment when anyone requests these:
@@ -19,7 +19,7 @@ def upload_Tensorflow_model_to_Google_Cloud_Vertex_AI(
1919
# explanation_parameters: "google.cloud.aiplatform_v1.types.explanation.ExplanationParameters" = None,
2020

2121
project: str = None,
22-
location: str = "us-central1",
22+
location: str = None,
2323
labels: dict = None,
2424
# encryption_spec_key_name: str = None,
2525
staging_bucket: str = None,
@@ -75,8 +75,7 @@ def upload_Tensorflow_model_to_Google_Cloud_Vertex_AI(
7575
func=upload_Tensorflow_model_to_Google_Cloud_Vertex_AI,
7676
base_image="python:3.9",
7777
packages_to_install=[
78-
# "google-cloud-aiplatform==1.9.0",
79-
"git+https://github.com/Ark-kun/python-aiplatform@1e1cbfef76b7c5c8db705d5c4c17c3691de7b032#egg=google-cloud-aiplatform&subdirectory=." # branch: fix--Fixed-getitng-project-ID-when-running-on-Vertex-AI
78+
"google-cloud-aiplatform==1.16.0",
8079
],
8180
annotations={
8281
"author": "Alexey Volkov <[email protected]>",

components/google-cloud/Vertex_AI/Models/Upload_Tensorflow_model/component.yaml

+8-9
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,15 @@ metadata:
33
annotations: {author: Alexey Volkov <[email protected]>, canonical_location: 'https://raw.githubusercontent.com/Ark-kun/pipeline_components/master/components/google-cloud/Vertex_AI/Models/Upload_Tensorflow_model/component.yaml'}
44
inputs:
55
- {name: model, type: TensorflowSavedModel}
6-
- {name: tensorflow_version, type: String, default: '2.7', optional: true}
6+
- {name: tensorflow_version, type: String, optional: true}
77
- name: use_gpu
88
type: Boolean
99
default: "False"
1010
optional: true
11-
- {name: display_name, type: String, default: Tensorflow model, optional: true}
11+
- {name: display_name, type: String, optional: true}
1212
- {name: description, type: String, optional: true}
1313
- {name: project, type: String, optional: true}
14-
- {name: location, type: String, default: us-central1, optional: true}
14+
- {name: location, type: String, optional: true}
1515
- {name: labels, type: JsonObject, optional: true}
1616
- {name: staging_bucket, type: String, optional: true}
1717
outputs:
@@ -24,9 +24,8 @@ implementation:
2424
- sh
2525
- -c
2626
- (PIP_DISABLE_PIP_VERSION_CHECK=1 python3 -m pip install --quiet --no-warn-script-location
27-
'git+https://github.com/Ark-kun/python-aiplatform@1e1cbfef76b7c5c8db705d5c4c17c3691de7b032#egg=google-cloud-aiplatform&subdirectory=.'
28-
|| PIP_DISABLE_PIP_VERSION_CHECK=1 python3 -m pip install --quiet --no-warn-script-location
29-
'git+https://github.com/Ark-kun/python-aiplatform@1e1cbfef76b7c5c8db705d5c4c17c3691de7b032#egg=google-cloud-aiplatform&subdirectory=.'
27+
'google-cloud-aiplatform==1.16.0' || PIP_DISABLE_PIP_VERSION_CHECK=1 python3
28+
-m pip install --quiet --no-warn-script-location 'google-cloud-aiplatform==1.16.0'
3029
--user) && "$0" "$@"
3130
- sh
3231
- -ec
@@ -37,10 +36,10 @@ implementation:
3736
- |
3837
def upload_Tensorflow_model_to_Google_Cloud_Vertex_AI(
3938
model_path,
40-
tensorflow_version = "2.7", # TODO: Remove the explicit default once the upload_tensorflow_saved_model supports None
39+
tensorflow_version = None,
4140
use_gpu = False,
4241
43-
display_name = "Tensorflow model",
42+
display_name = None,
4443
description = None,
4544
4645
# Uncomment when anyone requests these:
@@ -51,7 +50,7 @@ implementation:
5150
# explanation_parameters: "google.cloud.aiplatform_v1.types.explanation.ExplanationParameters" = None,
5251
5352
project = None,
54-
location = "us-central1",
53+
location = None,
5554
labels = None,
5655
# encryption_spec_key_name: str = None,
5756
staging_bucket = None,

0 commit comments

Comments
 (0)