-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Google Cloud - Vertex_AI - Models - Upload_Scikit-learn_pickle_model …
…- 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
Showing
2 changed files
with
6 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,15 +18,14 @@ def upload_Scikit_learn_pickle_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, | ||
) -> NamedTuple("Outputs", [ | ||
("model_name", "GoogleCloudVertexAiModelName"), | ||
("model_dict", dict), | ||
]): | ||
import datetime | ||
import json | ||
import os | ||
import shutil | ||
|
@@ -45,8 +44,6 @@ def upload_Scikit_learn_pickle_model_to_Google_Cloud_Vertex_AI( | |
_, renamed_model_path = tempfile.mkstemp(suffix=".pkl") | ||
shutil.copyfile(src=model_path, dst=renamed_model_path) | ||
|
||
display_name = display_name or "Scikit-learn model " + datetime.datetime.now().isoformat(sep=" ") | ||
|
||
model = aiplatform.Model.upload_scikit_learn_model_file( | ||
model_file_path=renamed_model_path, | ||
sklearn_version=sklearn_version, | ||
|
@@ -82,8 +79,7 @@ def upload_Scikit_learn_pickle_model_to_Google_Cloud_Vertex_AI( | |
func=upload_Scikit_learn_pickle_model_to_Google_Cloud_Vertex_AI, | ||
base_image="python:3.9", | ||
packages_to_install=[ | ||
# "google-cloud-aiplatform==1.10.0", | ||
"git+https://github.com/Ark-kun/python-aiplatform@9b50f62b9d1409644656fb3202edc7be19c722f4#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 <[email protected]>", | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters