Impersonate with `last_input_sequence` (#5456)

af7bd65f427e60b381e0392e9171b6997e94f7a4

CasualAutopsy <107777585+CasualAutopsy@users.noreply.github.com>

Signed
3 files changed, +3 -3Ignore whitespace
public/index.html+1 -1
@@ -4387,7 +4387,7 @@
43874387 <small data-i18n="First User Prefix">First User Prefix</small>
43884388 <textarea id="instruct_first_input_sequence" data-macros class="text_pole textarea_compact autoSetHeight"></textarea>
43894389 </div>
43904390 <div class="flexAuto" title="Inserted before the last User's message or as a last prompt line when generating an impersonation." data-i18n="[title]instruct_last_input_sequence">
43914391 <small data-i18n="Last User Prefix">Last User Prefix</small>
43924392 <textarea id="instruct_last_input_sequence" data-macros class="text_pole wide100p textarea_compact autoSetHeight"></textarea>
43934393 </div>
public/script.js+1 -1
@@ -4718,7 +4718,7 @@ export async function Generate(type, { automatic_trigger, force_name2, quiet_pro
47184718 chat2[i] = formatMessageHistoryItem(coreChat[j], isInstruct, force_output_sequence.FIRST);
47194719 }
47204720
47214721 if (lastUserMessageIndex >= 0 && j === lastUserMessageIndex && isInstruct && !isImpersonate) {
47224722 // Reformat with the last input sequence (if any)
47234723 chat2[i] = formatMessageHistoryItem(coreChat[j], isInstruct, force_output_sequence.LAST);
47244724 }
public/scripts/instruct-mode.js+1 -1
@@ -597,7 +597,7 @@ export function formatInstructModePrompt(name, isImpersonate, promptBias, name1,
597597 function getSequence() {
598598 // User impersonation prompt
599599 if (isImpersonate) {
600600 return instruct.last_input_sequence || instruct.input_sequence;
601601 }
602602
603603 // Neutral / system / quiet prompt