Class CreateTuningJobConfig.Builder

java.lang.Object
com.google.genai.types.CreateTuningJobConfig.Builder
Enclosing class:
CreateTuningJobConfig

public abstract static class CreateTuningJobConfig.Builder extends Object
Builder for CreateTuningJobConfig.
  • Constructor Details

    • Builder

      public Builder()
  • Method Details

    • httpOptions

      public abstract CreateTuningJobConfig.Builder httpOptions(HttpOptions httpOptions)
      Setter for httpOptions.

      httpOptions: Used to override HTTP request options.

    • httpOptions

      public CreateTuningJobConfig.Builder httpOptions(HttpOptions.Builder httpOptionsBuilder)
      Setter for httpOptions builder.

      httpOptions: Used to override HTTP request options.

    • validationDataset

      public abstract CreateTuningJobConfig.Builder validationDataset(TuningValidationDataset validationDataset)
      Setter for validationDataset.

      validationDataset: Cloud Storage path to file containing training dataset for tuning. The dataset must be formatted as a JSONL file.

    • validationDataset

      public CreateTuningJobConfig.Builder validationDataset(TuningValidationDataset.Builder validationDatasetBuilder)
      Setter for validationDataset builder.

      validationDataset: Cloud Storage path to file containing training dataset for tuning. The dataset must be formatted as a JSONL file.

    • tunedModelDisplayName

      public abstract CreateTuningJobConfig.Builder tunedModelDisplayName(String tunedModelDisplayName)
      Setter for tunedModelDisplayName.

      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

      public abstract CreateTuningJobConfig.Builder description(String description)
      Setter for description.

      description: The description of the TuningJob

    • epochCount

      public abstract CreateTuningJobConfig.Builder epochCount(Integer epochCount)
      Setter for epochCount.

      epochCount: Number of complete passes the model makes over the entire training dataset during training.

    • learningRateMultiplier

      public abstract CreateTuningJobConfig.Builder learningRateMultiplier(Float learningRateMultiplier)
      Setter for learningRateMultiplier.

      learningRateMultiplier: Multiplier for adjusting the default learning rate.

    • exportLastCheckpointOnly

      public abstract CreateTuningJobConfig.Builder exportLastCheckpointOnly(boolean exportLastCheckpointOnly)
      Setter for exportLastCheckpointOnly.

      exportLastCheckpointOnly: If set to true, disable intermediate checkpoints for SFT and only the last checkpoint will be exported. Otherwise, enable intermediate checkpoints for SFT.

    • preTunedModelCheckpointId

      public abstract CreateTuningJobConfig.Builder preTunedModelCheckpointId(String preTunedModelCheckpointId)
      Setter for preTunedModelCheckpointId.

      preTunedModelCheckpointId: The optional checkpoint id of the pre-tuned model to use for tuning, if applicable.

    • adapterSize

      public abstract CreateTuningJobConfig.Builder adapterSize(AdapterSize adapterSize)
      Setter for adapterSize.

      adapterSize: Adapter size for tuning.

    • adapterSize

      @CanIgnoreReturnValue public CreateTuningJobConfig.Builder adapterSize(AdapterSize.Known knownType)
      Setter for adapterSize given a known enum.

      adapterSize: Adapter size for tuning.

    • adapterSize

      @CanIgnoreReturnValue public CreateTuningJobConfig.Builder adapterSize(String adapterSize)
      Setter for adapterSize given a string.

      adapterSize: Adapter size for tuning.

    • batchSize

      public abstract CreateTuningJobConfig.Builder batchSize(Integer batchSize)
      Setter for batchSize.

      batchSize: The batch size hyperparameter for tuning. If not set, a default of 4 or 16 will be used based on the number of training examples.

    • learningRate

      public abstract CreateTuningJobConfig.Builder learningRate(Float learningRate)
      Setter for learningRate.

      learningRate: The learning rate hyperparameter for tuning. If not set, a default of 0.001 or 0.0002 will be calculated based on the number of training examples.

    • labels

      public abstract CreateTuningJobConfig.Builder labels(Map<String,String> labels)
      Setter for labels.

      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.

    • build

      public abstract CreateTuningJobConfig build()