Interface Datum.Builder

All Superinterfaces:
Buildable, CopyableBuilder<Datum.Builder,Datum>, SdkBuilder<Datum.Builder,Datum>, SdkPojo
Enclosing class:
Datum

@Mutable @NotThreadSafe public static interface Datum.Builder extends SdkPojo, CopyableBuilder<Datum.Builder,Datum>
  • Method Details

    • modelInput

      Datum.Builder modelInput(ModelInput modelInput)

      The tokenized input to feed to the model.

      Parameters:
      modelInput - The tokenized input to feed to the model.
      Returns:
      Returns a reference to this object so that method calls can be chained together.
    • modelInput

      default Datum.Builder modelInput(Consumer<ModelInput.Builder> modelInput)

      The tokenized input to feed to the model.

      This is a convenience method that creates an instance of the ModelInput.Builder avoiding the need to create one manually via ModelInput.builder().

      When the Consumer completes, SdkBuilder.build() is called immediately and its result is passed to modelInput(ModelInput).

      Parameters:
      modelInput - a consumer that will call methods on ModelInput.Builder
      Returns:
      Returns a reference to this object so that method calls can be chained together.
      See Also:
    • lossFnInputs

      Datum.Builder lossFnInputs(Map<String,TensorData> lossFnInputs)

      The tensor inputs for the loss function, keyed by name. Unsupported keys are rejected. Supported keys: target_tokens, weights, advantages, logprobs, ref_log_prob, temperature. Required keys depend on the loss function type: SFT ( cross_entropy) requires target_tokens and weights; RL ( ppo, cispo, importance_sampling) requires target_tokens, weights, advantages, and logprobs.

      Parameters:
      lossFnInputs - The tensor inputs for the loss function, keyed by name. Unsupported keys are rejected. Supported keys: target_tokens, weights, advantages, logprobs, ref_log_prob, temperature. Required keys depend on the loss function type: SFT (cross_entropy) requires target_tokens and weights; RL ( ppo, cispo, importance_sampling) requires target_tokens, weights, advantages, and logprobs.
      Returns:
      Returns a reference to this object so that method calls can be chained together.