Skip to content

Commit 32e3b22

Browse files
vertex-sdk-botcopybara-github
authored andcommitted
feat: Add pipeline_job_name to allow PipelineJob.get(pipeline_job_name)
PiperOrigin-RevId: 643162661
1 parent f0f13f2 commit 32e3b22

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

tests/unit/aiplatform/test_language_models.py

+4-2
Original file line numberDiff line numberDiff line change
@@ -2385,7 +2385,8 @@ def test_tune_text_embedding_model(
23852385
model = language_models_module.TextEmbeddingModel.from_pretrained(
23862386
base_model_version_id
23872387
)
2388-
tuning_job = model.tune_model(**tune_args)
2388+
tuning_result = model.tune_model(**tune_args)
2389+
23892390
call_kwargs = mock_pipeline_service_create.call_args[1]
23902391
pipeline_arguments = dict(
23912392
call_kwargs["pipeline_job"].runtime_config.parameter_values
@@ -2402,7 +2403,8 @@ def test_tune_text_embedding_model(
24022403
assert pipeline_arguments == expected_pipeline_args
24032404

24042405
# Testing the tuned model
2405-
tuned_model = tuning_job.deploy_tuned_model()
2406+
assert tuning_result.pipeline_job_name.startswith("sample-test-pipeline")
2407+
tuned_model = tuning_result.deploy_tuned_model()
24062408
assert (
24072409
tuned_model._endpoint_name
24082410
== test_constants.EndpointConstants._TEST_ENDPOINT_NAME

vertexai/language_models/_language_models.py

+5
Original file line numberDiff line numberDiff line change
@@ -3932,6 +3932,11 @@ def _get_tuned_model_name(self) -> str:
39323932
self._tuned_model_name = vertex_model_name
39333933
return vertex_model_name
39343934

3935+
@property
3936+
def pipeline_job_name(self) -> str:
3937+
"""Pipeline job name."""
3938+
return self._job.name
3939+
39353940
@property
39363941
def _status(self) -> Optional[aiplatform_types.pipeline_state.PipelineState]:
39373942
"""Job status."""

0 commit comments

Comments
 (0)