Skip to content

Commit f97e90f

Browse files
docs(samples): improve docstring of Vertex AI Python SDK Model Registry samples (#1705)
* improve doc string * nox tests passed * rename location Co-authored-by: Andrew Ferlitsch <aferlitsch@google.com>
1 parent fc5791b commit f97e90f

16 files changed

+43
-48
lines changed

samples/model-builder/model_registry/assign_aliases_model_version_sample.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,15 +32,15 @@ def assign_aliases_model_version_sample(
3232
model_id: The ID of the model.
3333
version_aliases: The version aliases to assign.
3434
version_id: The version ID of the model to assign the aliases to.
35-
project: The project name.
36-
location: The location name.
35+
project: The project ID.
36+
location: The region name.
3737
Returns
3838
None.
3939
"""
4040
# Initialize the client.
4141
aiplatform.init(project=project, location=location)
4242

43-
# Initialize the Model Registry resource with the ID 'model_id'.The parent_name of create method can be also
43+
# Initialize the Model Registry resource with the ID 'model_id'.The parent_name of the Model resource can be also
4444
# 'projects/<your-project-id>/locations/<your-region>/models/<your-model-id>'
4545
model_registry = aiplatform.models.ModelRegistry(model=model_id)
4646

samples/model-builder/model_registry/create_aliased_model_sample.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@ def create_aliased_model_sample(
2525
Args:
2626
model_id: The ID of the model to initialize. Parent resource name of the model is also accepted.
2727
version_id: The version ID or version alias of the model to initialize.
28-
project: The project.
29-
location: The location.
28+
project: The project ID.
29+
location: The region name.
3030
Returns:
3131
Model resource.
3232
"""

samples/model-builder/model_registry/create_default_model_sample.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,15 +22,15 @@ def create_default_model_sample(model_id: str, project: str, location: str):
2222
Initialize a Model resource to represent an existing model version with alias 'default'.
2323
Args:
2424
model_id: The ID of the model to initialize. Parent resource name of the model is also accepted.
25-
project: The project.
26-
location: The location.
25+
project: The project ID.
26+
location: The region name.
2727
Returns:
2828
Model resource.
2929
"""
3030
# Initialize the client.
3131
aiplatform.init(project=project, location=location)
3232

33-
# Initialize the Model resource with the ID 'model_id'. The parent_name of create method can be also
33+
# Initialize the Model resource with the ID 'model_id'. The parent_name of the Model resource can be also
3434
# 'projects/<your-project-id>/locations/<your-region>/models/<your-model-id>'
3535
default_model = aiplatform.Model(model_name=model_id)
3636

samples/model-builder/model_registry/create_model_registry_sample.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,16 +22,16 @@ def create_model_registry_sample(model_id: str, project: str, location: str):
2222
Create a ModelRegistry resource associated to model_id
2323
Args:
2424
model_id: The ID of the model.
25-
project: The project name.
26-
location: The location name.
25+
project: The project ID.
26+
location: The region name.
2727
Returns:
2828
ModelRegistry resource.
2929
"""
3030

3131
# Initialize the client.
3232
aiplatform.init(project=project, location=location)
3333

34-
# Initialize the Model Registry resource with the ID 'model_id'.The parent_name of create method can be also
34+
# Initialize the Model Registry resource with the ID 'model_id'.The parent_name of Model resource can be also
3535
# 'projects/<your-project-id>/locations/<your-region>/models/<your-model-id>'
3636
model_registry = aiplatform.models.ModelRegistry(model=model_id)
3737

samples/model-builder/model_registry/delete_aliases_model_version_sample.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,15 +32,15 @@ def delete_aliases_model_version_sample(
3232
model_id: The ID of the model.
3333
version_aliases: The version aliases to assign.
3434
version_id: The version ID of the model to assign the aliases to.
35-
project: The project name.
36-
location: The location name.
35+
project: The project ID.
36+
location: The region name.
3737
Returns
3838
None.
3939
"""
4040
# Initialize the client.
4141
aiplatform.init(project=project, location=location)
4242

43-
# Initialize the Model Registry resource with the ID 'model_id'.The parent_name of create method can be also
43+
# Initialize the Model Registry resource with the ID 'model_id'.The parent_name of Model resource can be also
4444
# 'projects/<your-project-id>/locations/<your-region>/models/<your-model-id>'
4545
model_registry = aiplatform.models.ModelRegistry(model=model_id)
4646

samples/model-builder/model_registry/delete_model_sample.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,14 +23,14 @@ def delete_model_sample(model_id: str, project: str, location: str):
2323
Args:
2424
model_id: The ID of the model to delete. Parent resource name of the model is also accepted.
2525
project: The project.
26-
location: The location.
26+
location: The region name.
2727
Returns
2828
None.
2929
"""
3030
# Initialize the client.
3131
aiplatform.init(project=project, location=location)
3232

33-
# Get the model with the ID 'model_id'. The parent_name of delete method can be also
33+
# Get the model with the ID 'model_id'. The parent_name of Model resource can be also
3434
# 'projects/<your-project-id>/locations/<your-region>/models/<your-model-id>'
3535
model = aiplatform.Model(model_name=model_id)
3636

samples/model-builder/model_registry/delete_model_version_sample.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,15 +25,15 @@ def delete_model_version_sample(
2525
Args:
2626
model_id: The ID of the model to delete. Parent resource name of the model is also accepted.
2727
version_id: The version ID or version alias of the model to delete.
28-
project: The project.
29-
location: The location.
28+
project: The project ID.
29+
location: The region name.
3030
Returns
3131
None.
3232
"""
3333
# Initialize the client.
3434
aiplatform.init(project=project, location=location)
3535

36-
# Initialize the Model Registry resource with the ID 'model_id'.The parent_name of create method can be also
36+
# Initialize the Model Registry resource with the ID 'model_id'.The parent_name of Model resource can be also
3737
# 'projects/<your-project-id>/locations/<your-region>/models/<your-model-id>'
3838
model_registry = aiplatform.models.ModelRegistry(model=model_id)
3939

samples/model-builder/model_registry/get_model_version_info_sample.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,16 +25,16 @@ def get_model_version_info_sample(
2525
Args:
2626
model_id: The ID of the model.
2727
version_id: The version ID of the model version.
28-
project: The project name.
29-
location: The location name.
28+
project: The project ID.
29+
location: The region name.
3030
Returns:
3131
VersionInfo resource.
3232
"""
3333

3434
# Initialize the client.
3535
aiplatform.init(project=project, location=location)
3636

37-
# Initialize the Model Registry resource with the ID 'model_id'.The parent_name of create method can be also
37+
# Initialize the Model Registry resource with the ID 'model_id'.The parent_name of Model resource can be also
3838
# 'projects/<your-project-id>/locations/<your-region>/models/<your-model-id>'
3939
model_registry = aiplatform.models.ModelRegistry(model=model_id)
4040

samples/model-builder/model_registry/get_registered_model_version_sample.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,16 +26,16 @@ def get_registered_model_version_sample(
2626
Get a registered model version.
2727
Args:
2828
model_id: The ID of the model. Parent resource name of the model is also accepted.
29-
project: The project.
30-
location: The location.
29+
project: The project ID.
30+
location: The region name.
3131
version_id: The version ID of the model.
3232
Returns:
3333
Model resource.
3434
"""
3535
# Initialize the client.
3636
aiplatform.init(project=project, location=location)
3737

38-
# Initialize the Model Registry resource with the ID 'model_id'. The parent_name of get method can be also
38+
# Initialize the Model Registry resource with the ID 'model_id'. The parent_name of Model resource can be also
3939
# 'projects/<your-project-id>/locations/<your-region>/models/<your-model-id>'
4040
model_registry = aiplatform.models.ModelRegistry(model=model_id)
4141

samples/model-builder/model_registry/list_model_versions_with_model_registry_sample.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,15 +22,15 @@ def list_model_versions_sample(model_id: str, project: str, location: str):
2222
List all model versions of a model.
2323
Args:
2424
model_id: The ID of the model to list. Parent resource name of the model is also accepted.
25-
project: The project.
26-
location: The location.
25+
project: The project ID.
26+
location: The region name.
2727
Returns:
2828
versions: List of model versions.
2929
"""
3030
# Initialize the client.
3131
aiplatform.init(project=project, location=location)
3232

33-
# Initialize the Model Registry resource with the ID 'model_id'.The parent_name of create method can be also
33+
# Initialize the Model Registry resource with the ID 'model_id'.The parent_name of Model resource can be also
3434
# 'projects/<your-project-id>/locations/<your-region>/models/<your-model-id>'
3535
model_registry = aiplatform.models.ModelRegistry(model=model_id)
3636

0 commit comments

Comments
 (0)