Skip to content

Commit af30dc8

Browse files
vertex-sdk-botcopybara-github
authored andcommitted
feat: Deprecate tuning public preview SDK in favor of tuning SDK
PiperOrigin-RevId: 844820962
1 parent df0976e commit af30dc8

File tree

2 files changed

+13
-3
lines changed

2 files changed

+13
-3
lines changed

vertexai/preview/tuning/_supervised_tuning.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,11 @@
1414
#
1515

1616
from typing import Dict, Literal, Optional, Union
17+
import warnings
1718

1819
from google.cloud.aiplatform.preview import datasets
1920
from google.cloud.aiplatform.utils import _ipython_utils
20-
from google.cloud.aiplatform_v1beta1.types import (
21-
tuning_job as gca_tuning_job_types,
22-
)
21+
from google.cloud.aiplatform_v1beta1.types import tuning_job as gca_tuning_job_types
2322
from vertexai import generative_models
2423
from vertexai.preview.tuning import _tuning
2524
from vertexai.preview.tuning._tuning import SourceModel
@@ -65,6 +64,11 @@ def train(
6564
Returns:
6665
A `TuningJob` object.
6766
"""
67+
warnings.warn(
68+
"This method is deprecated. Please use the `train` method in the `vertexai.tuning` package instead.",
69+
DeprecationWarning,
70+
stacklevel=2,
71+
)
6872
if tuning_mode is None:
6973
tuning_mode_value = None
7074
elif tuning_mode == "FULL":

vertexai/preview/tuning/_tuning.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
"""Classes to support Tuning."""
1717

1818
from typing import Dict, List, Optional, Union
19+
import warnings
1920

2021
from google.auth import credentials as auth_credentials
2122

@@ -74,6 +75,11 @@ def __init__(
7475
custom_base_model: str = "",
7576
):
7677
r"""Initializes SourceModel."""
78+
warnings.warn(
79+
"vertexai.preview.tuning.SourceModel is deprecated. Please use the `vertexai.tuning.SourceModel` instead.",
80+
DeprecationWarning,
81+
stacklevel=2,
82+
)
7783
self.base_model = base_model
7884
self.custom_base_model = custom_base_model
7985

0 commit comments

Comments
 (0)