Type Alias: LLamaContextualRepeatPenalty
ts
type LLamaContextualRepeatPenalty = {
lastTokens?: number;
punishTokensFilter?: (tokens: Token[]) => Token[];
penalizeNewLine?: boolean;
penalty?: number;
frequencyPenalty?: number;
presencePenalty?: number;
};Defined in: types.ts:386
Properties
lastTokens?
ts
optional lastTokens: number;Defined in: types.ts:391
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:393
Parameters
| Parameter | Type |
|---|---|
tokens | Token[] |
Returns
Token[]
penalizeNewLine?
ts
optional penalizeNewLine: boolean;Defined in: types.ts:399
Penalize new line tokens. Enabled by default.
penalty?
ts
optional penalty: number;Defined in: types.ts:406
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:413
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:420
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.