Limit NAI stop sequences count

This commit is contained in:
Cohee 2024-09-26 07:58:26 +00:00
parent c4462cc8bb
commit e6d5b5a8a1
1 changed files with 2 additions and 1 deletions

View File

@ -516,8 +516,9 @@ export function getNovelGenerationData(finalPrompt, settings, maxLength, isImper
stoppingStrings.push(...additionalStopStrings);
}
const MAX_STOP_SEQUENCES = 1024;
const stopSequences = (tokenizerType !== tokenizers.NONE)
? stoppingStrings.map(t => getTextTokens(tokenizerType, t))
? stoppingStrings.slice(0, MAX_STOP_SEQUENCES).map(t => getTextTokens(tokenizerType, t))
: undefined;
const badWordIds = (tokenizerType !== tokenizers.NONE)