Skip to content

Commit

Permalink
Google Cloud - Vertex_AI - Models - Upload_Tensorflow_model component…
Browse files Browse the repository at this point in the history
… - 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
  • Loading branch information
Ark-kun committed Aug 1, 2022
1 parent e1e8b7c commit 4677245
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@

def upload_Tensorflow_model_to_Google_Cloud_Vertex_AI(
model_path: InputPath("TensorflowSavedModel"),
tensorflow_version: str = "2.7", # TODO: Remove the explicit default once the upload_tensorflow_saved_model supports None
tensorflow_version: str = None,
use_gpu: bool = False,

display_name: str = "Tensorflow model",
display_name: str = None,
description: str = None,

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

project: str = None,
location: str = "us-central1",
location: str = None,
labels: dict = None,
# encryption_spec_key_name: str = None,
staging_bucket: str = None,
Expand Down Expand Up @@ -75,8 +75,7 @@ def upload_Tensorflow_model_to_Google_Cloud_Vertex_AI(
func=upload_Tensorflow_model_to_Google_Cloud_Vertex_AI,
base_image="python:3.9",
packages_to_install=[
# "google-cloud-aiplatform==1.9.0",
"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
"google-cloud-aiplatform==1.16.0",
],
annotations={
"author": "Alexey Volkov <alexey.volkov@ark-kun.com>",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@ metadata:
annotations: {author: Alexey Volkov <alexey.volkov@ark-kun.com>, canonical_location: 'https://raw.githubusercontent.com/Ark-kun/pipeline_components/master/components/google-cloud/Vertex_AI/Models/Upload_Tensorflow_model/component.yaml'}
inputs:
- {name: model, type: TensorflowSavedModel}
- {name: tensorflow_version, type: String, default: '2.7', optional: true}
- {name: tensorflow_version, type: String, optional: true}
- name: use_gpu
type: Boolean
default: "False"
optional: true
- {name: display_name, type: String, default: Tensorflow model, optional: true}
- {name: display_name, type: String, optional: true}
- {name: description, type: String, optional: true}
- {name: project, type: String, optional: true}
- {name: location, type: String, default: us-central1, optional: true}
- {name: location, type: String, optional: true}
- {name: labels, type: JsonObject, optional: true}
- {name: staging_bucket, type: String, optional: true}
outputs:
Expand All @@ -24,9 +24,8 @@ implementation:
- sh
- -c
- (PIP_DISABLE_PIP_VERSION_CHECK=1 python3 -m pip install --quiet --no-warn-script-location
'git+https://github.com/Ark-kun/python-aiplatform@1e1cbfef76b7c5c8db705d5c4c17c3691de7b032#egg=google-cloud-aiplatform&subdirectory=.'
|| PIP_DISABLE_PIP_VERSION_CHECK=1 python3 -m pip install --quiet --no-warn-script-location
'git+https://github.com/Ark-kun/python-aiplatform@1e1cbfef76b7c5c8db705d5c4c17c3691de7b032#egg=google-cloud-aiplatform&subdirectory=.'
'google-cloud-aiplatform==1.16.0' || PIP_DISABLE_PIP_VERSION_CHECK=1 python3
-m pip install --quiet --no-warn-script-location 'google-cloud-aiplatform==1.16.0'
--user) && "$0" "$@"
- sh
- -ec
Expand All @@ -37,10 +36,10 @@ implementation:
- |
def upload_Tensorflow_model_to_Google_Cloud_Vertex_AI(
model_path,
tensorflow_version = "2.7", # TODO: Remove the explicit default once the upload_tensorflow_saved_model supports None
tensorflow_version = None,
use_gpu = False,
display_name = "Tensorflow model",
display_name = None,
description = None,
# Uncomment when anyone requests these:
Expand All @@ -51,7 +50,7 @@ implementation:
# explanation_parameters: "google.cloud.aiplatform_v1.types.explanation.ExplanationParameters" = None,
project = None,
location = "us-central1",
location = None,
labels = None,
# encryption_spec_key_name: str = None,
staging_bucket = None,
Expand Down

0 comments on commit 4677245

Please sign in to comment.