Skip to content

Commit

Permalink
chore: Made it easier to request the latest framework version when ca…
Browse files Browse the repository at this point in the history
…lling Model.upload_* (#997)
  • Loading branch information
Ark-kun authored Feb 3, 2022
1 parent 9ebc972 commit 11d9af3
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions google/cloud/aiplatform/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -2534,7 +2534,7 @@ def export_model(
def upload_xgboost_model_file(
cls,
model_file_path: str,
xgboost_version: str = "1.4",
xgboost_version: Optional[str] = None,
display_name: str = "XGBoost model",
description: Optional[str] = None,
instance_schema_uri: Optional[str] = None,
Expand Down Expand Up @@ -2674,7 +2674,7 @@ def upload_xgboost_model_file(
container_image_uri = aiplatform.helpers.get_prebuilt_prediction_container_uri(
region=location,
framework="xgboost",
framework_version=xgboost_version,
framework_version=xgboost_version or "1.4",

This comment has been minimized.

Copy link
@morgandu

morgandu Feb 3, 2022

Contributor

Can all the specific framework versions being in a centralized section as constants, for the cases when later some default version need to be manually changed?

This comment has been minimized.

Copy link
@Ark-kun

Ark-kun Feb 22, 2022

Author Contributor

Thank you for the suggestion.
I think it would be a good idea.
Initially the code was like that.
However, I was asked to abandon that approach and switch to a different module that has a very different architecture and does not have this functionality. Perhaps the authors of that module might want to add support for this functionality.

See db65f67

accelerator="cpu",
)

Expand Down Expand Up @@ -2729,7 +2729,7 @@ def upload_xgboost_model_file(
def upload_scikit_learn_model_file(
cls,
model_file_path: str,
sklearn_version: str = "1.0",
sklearn_version: Optional[str] = None,
display_name: str = "Scikit-learn model",
description: Optional[str] = None,
instance_schema_uri: Optional[str] = None,
Expand Down Expand Up @@ -2869,7 +2869,7 @@ def upload_scikit_learn_model_file(
container_image_uri = aiplatform.helpers.get_prebuilt_prediction_container_uri(
region=location,
framework="sklearn",
framework_version=sklearn_version,
framework_version=sklearn_version or "1.0",
accelerator="cpu",
)

Expand Down Expand Up @@ -2923,7 +2923,7 @@ def upload_scikit_learn_model_file(
def upload_tensorflow_saved_model(
cls,
saved_model_dir: str,
tensorflow_version: str = "2.7",
tensorflow_version: Optional[str] = None,
use_gpu: bool = False,
display_name: str = "Tensorflow model",
description: Optional[str] = None,
Expand Down Expand Up @@ -3061,7 +3061,7 @@ def upload_tensorflow_saved_model(
container_image_uri = aiplatform.helpers.get_prebuilt_prediction_container_uri(
region=location,
framework="tensorflow",
framework_version=tensorflow_version,
framework_version=tensorflow_version or "2.7",
accelerator="gpu" if use_gpu else "cpu",
)

Expand Down

0 comments on commit 11d9af3

Please sign in to comment.