mirror of
https://github.com/SillyTavern/SillyTavern.git
synced 2024-12-12 01:17:39 +01:00
Generate: Fix prompt bias addition
If the bias is empty, don't add it. Signed-off-by: kingbri <bdashore3@proton.me>
This commit is contained in:
parent
60faaf1831
commit
ecfe8a722f
@ -2922,12 +2922,14 @@ async function Generate(type, { automatic_trigger, force_name2, resolve, reject,
|
||||
// Add prompt bias after everything else
|
||||
// Always run with continue
|
||||
if (!isInstruct && !isImpersonate && (tokens_already_generated === 0 || isContinue)) {
|
||||
const trimmedBias = promptBias.trimStart();
|
||||
if (promptBias.trim().length !== 0) {
|
||||
finalMesSend[finalMesSend.length - 1] +=
|
||||
/\s/.test(finalMesSend[finalMesSend.length - 1].slice(-1))
|
||||
? trimmedBias
|
||||
: ` ${trimmedBias}`;
|
||||
? promptBias.trimStart()
|
||||
: ` ${promptBias.trimStart()}`;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Prune from prompt cache if it exists
|
||||
if (generatedPromtCache.length !== 0) {
|
||||
|
Loading…
Reference in New Issue
Block a user