mirror of
https://github.com/SillyTavern/SillyTavern.git
synced 2025-01-05 21:46:49 +01:00
Support comma-separated list of llama.cpp sequence breakers #3026
This commit is contained in:
parent
542f77aeb8
commit
00f0f755fc
@ -1307,7 +1307,17 @@ export function getTextGenGenerationData(finalPrompt, maxTokens, isImpersonate,
|
||||
: [];
|
||||
const tokenBans = toIntArray(banned_tokens);
|
||||
logitBiasArray.push(...tokenBans.map(x => [Number(x), false]));
|
||||
const sequenceBreakers = (() => { try { return JSON.parse(params.dry_sequence_breakers); } catch { return undefined; } })();
|
||||
const sequenceBreakers = (() => {
|
||||
try {
|
||||
return JSON.parse(params.dry_sequence_breakers);
|
||||
} catch {
|
||||
if (typeof params.dry_sequence_breakers === 'string') {
|
||||
return params.dry_sequence_breakers.split(',');
|
||||
}
|
||||
|
||||
return undefined;
|
||||
}
|
||||
})();
|
||||
const llamaCppParams = {
|
||||
'logit_bias': logitBiasArray,
|
||||
// Conflicts with ooba's grammar_string
|
||||
|
Loading…
Reference in New Issue
Block a user