Skip to content

Commit 510c833

Browse files
vertex-sdk-botcopybara-github
authored andcommitted
fix: Upload the reference model in model registry
PiperOrigin-RevId: 630570083
1 parent 7279dab commit 510c833

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

google/cloud/aiplatform/models.py

+6-5
Original file line numberDiff line numberDiff line change
@@ -3272,10 +3272,11 @@ def upload(
32723272
if local_model:
32733273
container_spec = local_model.get_serving_container_spec()
32743274
appended_user_agent = [prediction_constants.CUSTOM_PREDICTION_ROUTINES]
3275+
elif not serving_container_image_uri and not artifact_uri:
3276+
# It's a referenced/place holder model.
3277+
container_spec = None
32753278
else:
3276-
# Referenced models do not have container_image and artifact_uri
3277-
# Skip the container_image if this is a referenced model
3278-
if not serving_container_image_uri and artifact_uri:
3279+
if not serving_container_image_uri:
32793280
raise ValueError(
32803281
"The parameter `serving_container_image_uri` is required "
32813282
"if no `local_model` is provided."
@@ -5256,10 +5257,10 @@ def evaluate(
52565257
the class "cat" corresponds with 0.97 in the example above.
52575258
prediction_label_column (str):
52585259
Optional. The column name of the field containing classes the model is scoring. Formatted to be able to find nested
5259-
columns, delimeted by `.`. If not set, defaulted to `prediction.classes` for classification.
5260+
columns, delimited by `.`. If not set, defaulted to `prediction.classes` for classification.
52605261
prediction_score_column (str):
52615262
Optional. The column name of the field containing batch prediction scores. Formatted to be able to find nested columns,
5262-
delimeted by `.`. If not set, defaulted to `prediction.scores` for a `classification` problem_type, `prediction.value`
5263+
delimited by `.`. If not set, defaulted to `prediction.scores` for a `classification` problem_type, `prediction.value`
52635264
for a `regression` problem_type.
52645265
staging_bucket (str):
52655266
Optional. The GCS directory to use for staging files from this evaluation job. Defaults to the value set in

0 commit comments

Comments
 (0)