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:439

Properties ​

lastTokens? ​

ts
optional lastTokens: number;

Defined in: types.ts:444

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:446

Parameters ​

ParameterType
tokensToken[]

Returns ​

Token[]


penalizeNewLine? ​

ts
optional penalizeNewLine: boolean;

Defined in: types.ts:452

Penalize new line tokens. Enabled by default.


penalty? ​

ts
optional penalty: number;

Defined in: types.ts:459

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:466

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:473

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.