Fix character name appending on user continue

This commit is contained in:
Cohee 2023-11-20 22:48:43 +02:00
parent cf853a21ad
commit ac4b673c5a
1 changed files with 4 additions and 2 deletions

View File

@ -3294,12 +3294,14 @@ async function Generate(type, { automatic_trigger, force_name2, resolve, reject,
} }
// Add character's name // Add character's name
// Force name append on continue // Force name append on continue (if not continuing on user message)
if (!isInstruct && force_name2) { if (!isInstruct && force_name2) {
if (!lastMesString.endsWith('\n')) { if (!lastMesString.endsWith('\n')) {
lastMesString += '\n'; lastMesString += '\n';
} }
lastMesString += `${name2}:`; if (!isContinue || !(chat[chat.length - 1]?.is_user)) {
lastMesString += `${name2}:`;
}
} }
return lastMesString; return lastMesString;