GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — fix: simplified predict schemata · googleapis/python-aiplatform@fc09010

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • google/cloud/aiplatform
    • models.py
  • tests/unit/aiplatform
    • test_training_jobs.py
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎google/cloud/aiplatform/models.py‎

Copy file name to clipboardExpand all lines: google/cloud/aiplatform/models.py
+9-5Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1100,16 +1100,20 @@ def upload(
11001100
health_route=serving_container_health_route,
11011101
)
11021102

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+
11031111
managed_model = gca_model.Model(
11041112
display_name=display_name,
11051113
description=description,
11061114
artifact_uri=artifact_uri,
11071115
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,
11131117
)
11141118

11151119
lro = api_client.upload_model(
Collapse file

‎tests/unit/aiplatform/test_training_jobs.py‎

Copy file name to clipboardExpand all lines: tests/unit/aiplatform/test_training_jobs.py
+1-6Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -758,12 +758,7 @@ def test_run_call_pipeline_service_create_with_no_dataset(
758758

759759
true_managed_model = gca_model.Model(
760760
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
767762
)
768763

769764
true_training_pipeline = gca_training_pipeline.TrainingPipeline(

0 commit comments

Comments
0 (0)
You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.