Skip to content

Commit

Permalink
samples: add model type for create_training_pipeline_image_classifica…
Browse files Browse the repository at this point in the history
…tion_sample (#891)
  • Loading branch information
morgandu committed Dec 8, 2021
1 parent 37ee0a1 commit a06da6d
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 0 deletions.
Expand Up @@ -24,6 +24,7 @@ def create_training_pipeline_image_classification_sample(
display_name: str,
dataset_id: int,
model_display_name: Optional[str] = None,
model_type: str = "CLOUD",
multi_label: bool = False,
training_fraction_split: float = 0.8,
validation_fraction_split: float = 0.1,
Expand All @@ -36,6 +37,7 @@ def create_training_pipeline_image_classification_sample(

job = aiplatform.AutoMLImageTrainingJob(
display_name=display_name,
model_type=model_type,
prediction_type='classification',
multi_label=multi_label
)
Expand Down
Expand Up @@ -45,6 +45,7 @@ def test_create_training_pipeline_image_classification_sample(
)
mock_get_automl_image_training_job.assert_called_once_with(
display_name=constants.DISPLAY_NAME,
model_type=constants.MODEL_TYPE,
multi_label=False,
prediction_type='classification'
)
Expand Down
1 change: 1 addition & 0 deletions samples/model-builder/test_constants.py
Expand Up @@ -196,3 +196,4 @@
"gs://bucket3/custom-training-python-package/my_app/trainer-0.1.tar.gz"
)
PYTHON_MODULE_NAME = "trainer.task"
MODEL_TYPE = "CLOUD"

0 comments on commit a06da6d

Please sign in to comment.