Skip to content

Commit

Permalink
feat: Support referenced models in SDK.
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 623654808
  • Loading branch information
vertex-sdk-bot authored and copybara-github committed Apr 11, 2024
1 parent 2d43438 commit c9b6b8b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
4 changes: 3 additions & 1 deletion google/cloud/aiplatform/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -3251,7 +3251,9 @@ def upload(
container_spec = local_model.get_serving_container_spec()
appended_user_agent = [prediction_constants.CUSTOM_PREDICTION_ROUTINES]
else:
if not serving_container_image_uri:
# Referenced models do not have container_image and artifact_uri
# Skip the container_image if this is a referenced model
if not serving_container_image_uri and artifact_uri:
raise ValueError(
"The parameter `serving_container_image_uri` is required "
"if no `local_model` is provided."
Expand Down
1 change: 1 addition & 0 deletions tests/unit/aiplatform/test_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -1293,6 +1293,7 @@ def test_upload_without_serving_container_image_uri_throw_error(
display_name=_TEST_MODEL_NAME,
serving_container_predict_route=_TEST_SERVING_CONTAINER_PREDICTION_ROUTE,
serving_container_health_route=_TEST_SERVING_CONTAINER_HEALTH_ROUTE,
artifact_uri=_TEST_ARTIFACT_URI,
)

assert str(exception.value) == expected_message
Expand Down

0 comments on commit c9b6b8b

Please sign in to comment.