It can be used to exponentially increase the likelihood of the text generation terminating once a specified number of tokens have been generated.

interface TextGenLengthPenalty {
    decay_factor?: number;
    start_index?: number;
}

Properties

decay_factor?: number

Represents the factor of exponential decay. Larger values correspond to more aggressive decay.

start_index?: number

A number of generated tokens after which this should take effect.