Class CreateTuningJobConfig
-
- All Implemented Interfaces:
public abstract class CreateTuningJobConfig extends JsonSerializable
Fine-tuning job creation request - optional fields.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public abstract classCreateTuningJobConfig.BuilderBuilder for CreateTuningJobConfig.
-
Field Summary
Fields Modifier and Type Field Description public final static StringMAX_READ_LENGTH_PROPERTY
-
Constructor Summary
Constructors Constructor Description CreateTuningJobConfig()
-
Method Summary
Modifier and Type Method Description abstract Optional<HttpOptions>httpOptions()Used to override HTTP request options. abstract Optional<TuningMethod>method()The method to use for tuning (SUPERVISED_FINE_TUNING or PREFERENCE_TUNING or DISTILLATION). abstract Optional<TuningValidationDataset>validationDataset()Validation dataset for tuning. abstract Optional<String>tunedModelDisplayName()The display name of the tuned Model. abstract Optional<String>description()The description of the TuningJob abstract Optional<Integer>epochCount()Number of complete passes the model makes over the entire training dataset during training. abstract Optional<Float>learningRateMultiplier()Multiplier for adjusting the default learning rate. abstract Optional<Boolean>exportLastCheckpointOnly()If set to true, disable intermediate checkpoints and only the last checkpoint will be exported. abstract Optional<String>preTunedModelCheckpointId()The optional checkpoint id of the pre-tuned model to use for tuning, if applicable. abstract Optional<AdapterSize>adapterSize()Adapter size for tuning. abstract Optional<TuningMode>tuningMode()Tuning mode for tuning. abstract Optional<String>customBaseModel()Custom base model for tuning. abstract Optional<Integer>batchSize()The batch size hyperparameter for tuning. abstract Optional<Float>learningRate()The learning rate for tuning. abstract Optional<EvaluationConfig>evaluationConfig()Evaluation config for the tuning job. abstract Optional<Map<String, String>>labels()Optional. abstract Optional<Float>beta()Weight for KL Divergence regularization, Preference Optimization tuning only. abstract Optional<String>baseTeacherModel()The base teacher model that is being distilled. abstract Optional<String>tunedTeacherModelSource()The resource name of the Tuned teacher model. abstract Optional<Float>sftLossWeightMultiplier()Multiplier for adjusting the weight of the SFT loss. abstract Optional<String>outputUri()The Google Cloud Storage location where the tuning job outputs are written. abstract Optional<EncryptionSpec>encryptionSpec()The encryption spec of the tuning job. static CreateTuningJobConfig.Builderbuilder()Instantiates a builder for CreateTuningJobConfig. abstract CreateTuningJobConfig.BuildertoBuilder()Creates a builder with the same values as this instance. static CreateTuningJobConfigfromJson(String jsonString)Deserializes a JSON string to a CreateTuningJobConfig object. -
Methods inherited from class com.google.genai.JsonSerializable
fromJsonNode, fromJsonString, objectMapper, setMaxReadLength, stringToJsonNode, toJson, toJsonNode, toJsonString -
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
-
Method Detail
-
httpOptions
abstract Optional<HttpOptions> httpOptions()
Used to override HTTP request options.
-
method
abstract Optional<TuningMethod> method()
The method to use for tuning (SUPERVISED_FINE_TUNING or PREFERENCE_TUNING or DISTILLATION). If not set, the default method (SFT) will be used.
-
validationDataset
abstract Optional<TuningValidationDataset> validationDataset()
Validation dataset for tuning. The dataset must be formatted as a JSONL file.
-
tunedModelDisplayName
abstract Optional<String> tunedModelDisplayName()
The display name of the tuned Model. The name can be up to 128 characters long and can consist of any UTF-8 characters.
-
description
abstract Optional<String> description()
The description of the TuningJob
-
epochCount
abstract Optional<Integer> epochCount()
Number of complete passes the model makes over the entire training dataset during training.
-
learningRateMultiplier
abstract Optional<Float> learningRateMultiplier()
Multiplier for adjusting the default learning rate. 1P models only. Mutually exclusive with learning_rate.
-
exportLastCheckpointOnly
abstract Optional<Boolean> exportLastCheckpointOnly()
If set to true, disable intermediate checkpoints and only the last checkpoint will be exported. Otherwise, enable intermediate checkpoints.
-
preTunedModelCheckpointId
abstract Optional<String> preTunedModelCheckpointId()
The optional checkpoint id of the pre-tuned model to use for tuning, if applicable.
-
adapterSize
abstract Optional<AdapterSize> adapterSize()
Adapter size for tuning.
-
tuningMode
abstract Optional<TuningMode> tuningMode()
Tuning mode for tuning.
-
customBaseModel
abstract Optional<String> customBaseModel()
Custom base model for tuning. This is only supported for OSS models in Gemini Enterprise Agent Platform.
-
batchSize
abstract Optional<Integer> batchSize()
The batch size hyperparameter for tuning. This is only supported for OSS models in Gemini Enterprise Agent Platform.
-
learningRate
abstract Optional<Float> learningRate()
The learning rate for tuning. OSS models only. Mutually exclusive with learning_rate_multiplier.
-
evaluationConfig
abstract Optional<EvaluationConfig> evaluationConfig()
Evaluation config for the tuning job.
-
labels
abstract Optional<Map<String, String>> labels()
Optional. The labels with user-defined metadata to organize TuningJob and generated resources such as Model and Endpoint. Label keys and values can be no longer than 64 characters (Unicode codepoints), can only contain lowercase letters, numeric characters, underscores and dashes. International characters are allowed. See https://goo.gl/xmQnxf for more information and examples of labels.
-
beta
abstract Optional<Float> beta()
Weight for KL Divergence regularization, Preference Optimization tuning only.
-
baseTeacherModel
abstract Optional<String> baseTeacherModel()
The base teacher model that is being distilled. Distillation only.
-
tunedTeacherModelSource
abstract Optional<String> tunedTeacherModelSource()
The resource name of the Tuned teacher model. Distillation only.
-
sftLossWeightMultiplier
abstract Optional<Float> sftLossWeightMultiplier()
Multiplier for adjusting the weight of the SFT loss. Distillation only.
-
outputUri
abstract Optional<String> outputUri()
The Google Cloud Storage location where the tuning job outputs are written.
-
encryptionSpec
abstract Optional<EncryptionSpec> encryptionSpec()
The encryption spec of the tuning job. Customer-managed encryption key options for a TuningJob. If this is set, then all resources created by the TuningJob will be encrypted with provided encryption key.
-
builder
static CreateTuningJobConfig.Builder builder()
Instantiates a builder for CreateTuningJobConfig.
-
toBuilder
abstract CreateTuningJobConfig.Builder toBuilder()
Creates a builder with the same values as this instance.
-
fromJson
static CreateTuningJobConfig fromJson(String jsonString)
Deserializes a JSON string to a CreateTuningJobConfig object.
-
-
-
-