Interface SamplingParams.Builder

  • Method Details

    • maxTokens

      SamplingParams.Builder maxTokens(Integer maxTokens)

      The maximum number of tokens to generate per sample.

      Parameters:
      maxTokens - The maximum number of tokens to generate per sample.
      Returns:
      Returns a reference to this object so that method calls can be chained together.
    • temperature

      SamplingParams.Builder temperature(Double temperature)

      The sampling temperature controlling randomness. Higher values produce more diverse outputs.

      Parameters:
      temperature - The sampling temperature controlling randomness. Higher values produce more diverse outputs.
      Returns:
      Returns a reference to this object so that method calls can be chained together.
    • topK

      The number of highest-probability vocabulary tokens to keep for top-k filtering. Set to -1 to disable.

      Parameters:
      topK - The number of highest-probability vocabulary tokens to keep for top-k filtering. Set to -1 to disable.
      Returns:
      Returns a reference to this object so that method calls can be chained together.
    • topP

      The cumulative probability threshold for nucleus (top-p) sampling. Only tokens with cumulative probability below this threshold are considered.

      Parameters:
      topP - The cumulative probability threshold for nucleus (top-p) sampling. Only tokens with cumulative probability below this threshold are considered.
      Returns:
      Returns a reference to this object so that method calls can be chained together.
    • seed

      The random seed for reproducible sampling. When set, the same seed with the same input produces deterministic outputs.

      Parameters:
      seed - The random seed for reproducible sampling. When set, the same seed with the same input produces deterministic outputs.
      Returns:
      Returns a reference to this object so that method calls can be chained together.
    • stop

      The list of stop sequences that terminate generation when encountered in the output.

      Parameters:
      stop - The list of stop sequences that terminate generation when encountered in the output.
      Returns:
      Returns a reference to this object so that method calls can be chained together.
    • stop

      The list of stop sequences that terminate generation when encountered in the output.

      Parameters:
      stop - The list of stop sequences that terminate generation when encountered in the output.
      Returns:
      Returns a reference to this object so that method calls can be chained together.