Module sft (1.122.0)

Classes for supervised tuning.

Classes

SupervisedTuningJob

SupervisedTuningJob(tuning_job_name: str)

Initializes class with project, location, and api_client.

Parameters
Name Description
project str

Project of the resource noun.

location str

The location of the resource noun.

credentials google.auth.credentials.Credentials

Optional custom credentials to use when accessing interacting with resource noun.

resource_name str

A fully-qualified resource name or ID.

Modules Functions

preview_train

preview_train(
 *,
 source_model: typing.Union[
 str,
 vertexai.generative_models.GenerativeModel,
 vertexai.preview.tuning._tuning.SourceModel,
 ],
 train_dataset: typing.Union[
 str, google.cloud.aiplatform.preview.datasets.MultimodalDataset
 ],
 validation_dataset: typing.Optional[
 typing.Union[str, google.cloud.aiplatform.preview.datasets.MultimodalDataset]
 ] = None,
 tuned_model_display_name: typing.Optional[str] = None,
 tuning_mode: typing.Optional[typing.Literal["FULL", "PEFT_ADAPTER"]] = None,
 epochs: typing.Optional[int] = None,
 learning_rate: typing.Optional[float] = None,
 learning_rate_multiplier: typing.Optional[float] = None,
 adapter_size: typing.Optional[typing.Literal[1, 4, 8, 16, 32]] = None,
 labels: typing.Optional[typing.Dict[str, str]] = None,
 output_uri: typing.Optional[str] = None
) -> vertexai.preview.tuning._supervised_tuning.SupervisedTuningJob

Tunes a model using supervised training.

Parameter
Name Description
source_model str

Model name for tuning, e.g., "gemini-1.0-pro-002".

rebase_tuned_model

rebase_tuned_model(
 tuned_model_ref: str,
 *,
 artifact_destination: typing.Optional[str] = None,
 deploy_to_same_endpoint: typing.Optional[bool] = False
)

Re-runs fine tuning on top of a new foundational model.

Takes a legacy Tuned GenAI model Reference and creates a TuningJob based on a new model.

train

train(
 *,
 source_model: typing.Union[str, vertexai.generative_models.GenerativeModel],
 train_dataset: typing.Union[
 str, google.cloud.aiplatform.preview.datasets.MultimodalDataset
 ],
 validation_dataset: typing.Optional[
 typing.Union[str, google.cloud.aiplatform.preview.datasets.MultimodalDataset]
 ] = None,
 tuned_model_display_name: typing.Optional[str] = None,
 epochs: typing.Optional[int] = None,
 learning_rate_multiplier: typing.Optional[float] = None,
 adapter_size: typing.Optional[typing.Literal[1, 4, 8, 16, 32]] = None,
 labels: typing.Optional[typing.Dict[str, str]] = None
) -> vertexai.tuning._supervised_tuning.SupervisedTuningJob

Tunes a model using supervised training.

Parameter
Name Description
source_model str

Model name for tuning, e.g., "gemini-1.0-pro-002".

Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.

Last updated 2025年10月30日 UTC.