diff --git a/vertexai/preview/tuning/_supervised_tuning.py b/vertexai/preview/tuning/_supervised_tuning.py index 7c90f20f6d..05847e6cd0 100644 --- a/vertexai/preview/tuning/_supervised_tuning.py +++ b/vertexai/preview/tuning/_supervised_tuning.py @@ -14,12 +14,11 @@ # from typing import Dict, Literal, Optional, Union +import warnings from google.cloud.aiplatform.preview import datasets from google.cloud.aiplatform.utils import _ipython_utils -from google.cloud.aiplatform_v1beta1.types import ( - tuning_job as gca_tuning_job_types, -) +from google.cloud.aiplatform_v1beta1.types import tuning_job as gca_tuning_job_types from vertexai import generative_models from vertexai.preview.tuning import _tuning from vertexai.preview.tuning._tuning import SourceModel @@ -65,6 +64,11 @@ def train( Returns: A `TuningJob` object. """ + warnings.warn( + "This method is deprecated. Please use the `train` method in the `vertexai.tuning` package instead.", + DeprecationWarning, + stacklevel=2, + ) if tuning_mode is None: tuning_mode_value = None elif tuning_mode == "FULL": diff --git a/vertexai/preview/tuning/_tuning.py b/vertexai/preview/tuning/_tuning.py index 0ea7496854..fd569c4381 100644 --- a/vertexai/preview/tuning/_tuning.py +++ b/vertexai/preview/tuning/_tuning.py @@ -16,6 +16,7 @@ """Classes to support Tuning.""" from typing import Dict, List, Optional, Union +import warnings from google.auth import credentials as auth_credentials @@ -74,6 +75,11 @@ def __init__( custom_base_model: str = "", ): r"""Initializes SourceModel.""" + warnings.warn( + "vertexai.preview.tuning.SourceModel is deprecated. Please use the `vertexai.tuning.SourceModel` instead.", + DeprecationWarning, + stacklevel=2, + ) self.base_model = base_model self.custom_base_model = custom_base_model