GeezerVison is showing github.com — fix: simplified predict schemata · googleapis/python-aiplatform@fc09010
File tree
Expand file treeCollapse file tree
Open diff view settings
Expand file treeCollapse file tree
Open diff view settings
Collapse file
Copy file name to clipboardExpand all lines: google/cloud/aiplatform/models.py +9-5Lines changed: 9 additions & 5 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -1100,16 +1100,20 @@ def upload( |
1100 | 1100 | health_route=serving_container_health_route, |
1101 | 1101 | ) |
1102 | 1102 |
|
| 1103 | + model_predict_schemata = None |
| 1104 | + if any([instance_schema_uri, parameters_schema_uri, prediction_schema_uri,]): |
| 1105 | + model_predict_schemata = gca_model.PredictSchemata( |
| 1106 | + instance_schema_uri=instance_schema_uri, |
| 1107 | + parameters_schema_uri=parameters_schema_uri, |
| 1108 | + prediction_schema_uri=prediction_schema_uri, |
| 1109 | + ) |
| 1110 | + |
1103 | 1111 | managed_model = gca_model.Model( |
1104 | 1112 | display_name=display_name, |
1105 | 1113 | description=description, |
1106 | 1114 | artifact_uri=artifact_uri, |
1107 | 1115 | container_spec=container_spec, |
1108 | | - predict_schemata=gca_model.PredictSchemata( |
1109 | | - instance_schema_uri=instance_schema_uri, |
1110 | | - parameters_schema_uri=parameters_schema_uri, |
1111 | | - prediction_schema_uri=prediction_schema_uri, |
1112 | | - ), |
| 1116 | + predict_schemata=model_predict_schemata, |
1113 | 1117 | ) |
1114 | 1118 |
|
1115 | 1119 | lro = api_client.upload_model( |
|
Collapse file
Copy file name to clipboardExpand all lines: tests/unit/aiplatform/test_training_jobs.py +1-6Lines changed: 1 addition & 6 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -758,12 +758,7 @@ def test_run_call_pipeline_service_create_with_no_dataset( |
758 | 758 |
|
759 | 759 | true_managed_model = gca_model.Model( |
760 | 760 | display_name=_TEST_MODEL_DISPLAY_NAME, |
761 | | - container_spec=true_container_spec, |
762 | | - predict_schemata=gca_model.PredictSchemata( |
763 | | - instance_schema_uri=None, |
764 | | - parameters_schema_uri=None, |
765 | | - prediction_schema_uri=None, |
766 | | - ), |
| 761 | + container_spec=true_container_spec |
767 | 762 | ) |
768 | 763 |
|
769 | 764 | true_training_pipeline = gca_training_pipeline.TrainingPipeline( |
|