mirror of
https://github.com/SillyTavern/SillyTavern.git
synced 2025-06-05 21:59:27 +02:00
Safe sequence breakers parse
This commit is contained in:
@ -1307,12 +1307,13 @@ export function getTextGenGenerationData(finalPrompt, maxTokens, isImpersonate,
|
|||||||
: [];
|
: [];
|
||||||
const tokenBans = toIntArray(banned_tokens);
|
const tokenBans = toIntArray(banned_tokens);
|
||||||
logitBiasArray.push(...tokenBans.map(x => [Number(x), false]));
|
logitBiasArray.push(...tokenBans.map(x => [Number(x), false]));
|
||||||
|
const sequenceBreakers = (() => { try { return JSON.parse(params.dry_sequence_breakers); } catch { return undefined; } })();
|
||||||
const llamaCppParams = {
|
const llamaCppParams = {
|
||||||
'logit_bias': logitBiasArray,
|
'logit_bias': logitBiasArray,
|
||||||
// Conflicts with ooba's grammar_string
|
// Conflicts with ooba's grammar_string
|
||||||
'grammar': settings.grammar_string,
|
'grammar': settings.grammar_string,
|
||||||
'cache_prompt': true,
|
'cache_prompt': true,
|
||||||
'dry_sequence_breakers': JSON.parse(params.dry_sequence_breakers),
|
'dry_sequence_breakers': sequenceBreakers,
|
||||||
};
|
};
|
||||||
params = Object.assign(params, llamaCppParams);
|
params = Object.assign(params, llamaCppParams);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user