Skip to content

Commit

Permalink
fix: Remove check on serving_container_image_uri when artifact_uri an…
Browse files Browse the repository at this point in the history
…d local_model is given

COPYBARA_INTEGRATE_REVIEW=#4558 from rragundez:patch-1 d7ff12e
PiperOrigin-RevId: 696672287
  • Loading branch information
rragundez authored and copybara-github committed Nov 14, 2024
1 parent 11e5378 commit ccd89b4
Showing 1 changed file with 3 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 @@ -5020,7 +5020,9 @@ def upload(
if not model_dir.exists():
raise ValueError(f"artifact_uri path does not exist: '{artifact_uri}'")
PREBUILT_IMAGE_RE = "(us|europe|asia)-docker.pkg.dev/vertex-ai/prediction/"
if re.match(PREBUILT_IMAGE_RE, serving_container_image_uri):
if serving_container_image_uri and re.match(
PREBUILT_IMAGE_RE, serving_container_image_uri
):
if not model_dir.is_dir():
raise ValueError(
f"artifact_uri path must be a directory: '{artifact_uri}' when using prebuilt image '{serving_container_image_uri}'"
Expand Down

0 comments on commit ccd89b4

Please sign in to comment.