Skip to content

Type alias: LlamaContextRepeatPenalty

ts
type LlamaContextRepeatPenalty: {
  frequencyPenalty: number;
  penalty: number;
  presencePenalty: number;
  punishTokens: Uint32Array | () => Uint32Array;
};
type LlamaContextRepeatPenalty: {
  frequencyPenalty: number;
  penalty: number;
  presencePenalty: number;
  punishTokens: Uint32Array | () => Uint32Array;
};

Type declaration

frequencyPenalty

ts
frequencyPenalty?: number;
frequencyPenalty?: number;

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.

penalty

ts
penalty?: number;
penalty?: number;

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

presencePenalty

ts
presencePenalty?: number;
presencePenalty?: number;

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.

punishTokens

ts
punishTokens: Uint32Array | () => Uint32Array;
punishTokens: Uint32Array | () => Uint32Array;

Tokens to lower the predication probability of to be the next predicted token

Source

llamaEvaluator/LlamaContext.ts:39