Skip to content

Type Alias: LLamaContextualRepeatPenalty

ts
type LLamaContextualRepeatPenalty = {
  lastTokens?: number;
  punishTokensFilter?: (tokens: Token[]) => Token[];
  penalizeNewLine?: boolean;
  penalty?: number;
  frequencyPenalty?: number;
  presencePenalty?: number;
};

Defined in: types.ts:379

Properties

lastTokens?

ts
optional lastTokens: number;

Defined in: types.ts:384

Number of recent tokens generated by the model to apply penalties to repetition of. Defaults to 64.


punishTokensFilter()?

ts
optional punishTokensFilter: (tokens: Token[]) => Token[];

Defined in: types.ts:386

Parameters

ParameterType
tokensToken[]

Returns

Token[]


penalizeNewLine?

ts
optional penalizeNewLine: boolean;

Defined in: types.ts:392

Penalize new line tokens. Enabled by default.


penalty?

ts
optional penalty: number;

Defined in: types.ts:399

The relative amount to lower the probability of the tokens in punishTokens by Defaults to 1.1. Set to 1 to disable.


frequencyPenalty?

ts
optional frequencyPenalty: number;

Defined in: types.ts:406

For n time a token is in the punishTokens array, lower its probability by n * frequencyPenalty Disabled by default (0). Set to a value between 0 and 1 to enable.


presencePenalty?

ts
optional presencePenalty: number;

Defined in: types.ts:413

Lower the probability of all the tokens in the punishTokens array by presencePenalty Disabled by default (0). Set to a value between 0 and 1 to enable.