Remove extraneous newlines when formatting quiet prompts

This commit is contained in:
Cohee 2024-03-30 15:54:42 +02:00
parent 9987ec33d9
commit e99d37d549
2 changed files with 6 additions and 1 deletions

View File

@ -3555,7 +3555,7 @@ async function Generate(type, { automatic_trigger, force_name2, quiet_prompt, qu
//TODO: respect output_sequence vs last_output_sequence settings
//TODO: decide how to prompt this to clarify who is talking 'Narrator', 'System', etc.
if (isInstruct) {
lastMesString += '\n' + quietAppend; // + power_user.instruct.output_sequence + '\n';
lastMesString += quietAppend; // + power_user.instruct.output_sequence + '\n';
} else {
lastMesString += quietAppend;
}

View File

@ -458,6 +458,11 @@ export function formatInstructModePrompt(name, isImpersonate, promptBias, name1,
const separator = power_user.instruct.wrap ? '\n' : '';
let text = includeNames ? (separator + sequence + separator + `${name}:`) : (separator + sequence);
// Quiet prompt already has a newline at the end
if (isQuiet && separator) {
text = text.slice(separator.length);
}
if (!isImpersonate && promptBias) {
text += (includeNames ? promptBias : (separator + promptBias.trimStart()));
}