I have a model uploaded to Model Registry, which I am successfully deploying to an endpoint with the code below:
from google.cloud import aiplatform
aiplatform.init(project="test-project", location="us-west2")
model = aiplatform.Model.upload(
display_name="test-model",
artifact_uri="gs://test-bucket/model",
serving_container_image_uri="us-west2-docker.pkg.dev/test-project/test-docker-repo/test-inferencer:latest",
serving_container_environment_variables={
"HF_TASK": "zero-shot-classification",
"VERTEX_CPR_WEB_CONCURRENCY": 1,
},
)
endpoint = model.deploy(
machine_type="n1-standard-4",
accelerator_type="NVIDIA_TESLA_T4",
accelerator_count=1,
max_replica_count=10,
)
I can update the model version in the registry with the code below:
model_v2 = aiplatform.Model.upload(
parent_model=model.resource_name,
display_name="test-model",
artifact_uri="gs://test-bucket/model_v2",
serving_container_image_uri="us-west2-docker.pkg.dev/test-project/test-docker-repo/test-inferencer:latest",
serving_container_environment_variables={
"HF_TASK": "zero-shot-classification",
"VERTEX_CPR_WEB_CONCURRENCY": 1,
},
)
But how do I update the model version in the endpoint? Do I have to undeploy the old model and deploy the new one to the endpoint, or is there a way to make it update automatically?
TIA