mirror of
https://github.com/SillyTavern/SillyTavern.git
synced 2025-03-02 10:57:45 +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,13 +2922,15 @@ async function Generate(type, { automatic_trigger, force_name2, resolve, reject,
|
|||||||
// Add prompt bias after everything else
|
// Add prompt bias after everything else
|
||||||
// Always run with continue
|
// Always run with continue
|
||||||
if (!isInstruct && !isImpersonate && (tokens_already_generated === 0 || isContinue)) {
|
if (!isInstruct && !isImpersonate && (tokens_already_generated === 0 || isContinue)) {
|
||||||
const trimmedBias = promptBias.trimStart();
|
if (promptBias.trim().length !== 0) {
|
||||||
finalMesSend[finalMesSend.length - 1] +=
|
finalMesSend[finalMesSend.length - 1] +=
|
||||||
/\s/.test(finalMesSend[finalMesSend.length - 1].slice(-1))
|
/\s/.test(finalMesSend[finalMesSend.length - 1].slice(-1))
|
||||||
? trimmedBias
|
? promptBias.trimStart()
|
||||||
: ` ${trimmedBias}`;
|
: ` ${promptBias.trimStart()}`;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// Prune from prompt cache if it exists
|
// Prune from prompt cache if it exists
|
||||||
if (generatedPromtCache.length !== 0) {
|
if (generatedPromtCache.length !== 0) {
|
||||||
generatedPromtCache = cleanupPromptCache(generatedPromtCache);
|
generatedPromtCache = cleanupPromptCache(generatedPromtCache);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user