@@ -392,6 +392,8 @@ def create(
392
392
Required. A fully-qualified model resource name or model ID.
393
393
Example: "projects/123/locations/us-central1/models/456" or
394
394
"456" when project and location are initialized or passed.
395
+ May optionally contain a version ID or alias in
396
+ {model_name}@{version} form.
395
397
396
398
Or an instance of aiplatform.Model.
397
399
instances_format (str):
@@ -564,6 +566,7 @@ def create(
564
566
format_resource_name_method = aiplatform .Model ._format_resource_name ,
565
567
project = project ,
566
568
location = location ,
569
+ resource_id_validator = super ()._revisioned_resource_id_validator ,
567
570
)
568
571
569
572
# Raise error if both or neither source URIs are provided
@@ -713,7 +716,9 @@ def _create(
713
716
Required. BatchPredictionJob without _gca_resource populated.
714
717
model_or_model_name (Union[str, aiplatform.Model]):
715
718
Required. Required. A fully-qualified model resource name or
716
- an instance of aiplatform.Model.
719
+ an instance of aiplatform.Model. If a resource name, it may
720
+ optionally contain a version ID or alias in
721
+ {model_name}@{version} form.
717
722
gca_batch_prediction_job (gca_bp_job.BatchPredictionJob):
718
723
Required. a batch prediction job proto for creating a batch prediction job on Vertex AI.
719
724
generate_explanation (bool):
@@ -731,7 +736,6 @@ def _create(
731
736
provided instances_format or predictions_format are not supported
732
737
by Vertex AI.
733
738
"""
734
- # select v1beta1 if explain else use default v1
735
739
736
740
parent = initializer .global_config .common_location_path (
737
741
project = empty_batch_prediction_job .project ,
@@ -741,7 +745,7 @@ def _create(
741
745
model_resource_name = (
742
746
model_or_model_name
743
747
if isinstance (model_or_model_name , str )
744
- else model_or_model_name .resource_name
748
+ else model_or_model_name .versioned_resource_name
745
749
)
746
750
747
751
gca_batch_prediction_job .model = model_resource_name
0 commit comments