Fix edge case with newlines in quiet prompts with wrap enabled

This commit is contained in:
Cohee
2024-03-30 16:04:10 +02:00
parent e99d37d549
commit 34c79049ad

View File

@@ -3514,7 +3514,7 @@ async function Generate(type, { automatic_trigger, force_name2, quiet_prompt, qu
// Cohee: This removes a newline from the end of the last message in the context // Cohee: This removes a newline from the end of the last message in the context
// Last prompt line will add a newline if it's not a continuation // Last prompt line will add a newline if it's not a continuation
if (i === arrMes.length - 1 && type !== 'continue') { if (i === arrMes.length - 1 && type !== 'continue') {
if (!isInstruct || power_user.instruct.wrap) { if (!isInstruct || (power_user.instruct.wrap && type !== 'quiet')) {
item = item.replace(/\n?$/, ''); item = item.replace(/\n?$/, '');
} }
} }