Impersonate with last_input_sequence (#5456)
This commit is contained in:
+1
-1
@@ -4387,7 +4387,7 @@
|
||||
<small data-i18n="First User Prefix">First User Prefix</small>
|
||||
<textarea id="instruct_first_input_sequence" data-macros class="text_pole textarea_compact autoSetHeight"></textarea>
|
||||
</div>
|
||||
<div class="flexAuto" title="Inserted before the last User's message." data-i18n="[title]instruct_last_input_sequence">
|
||||
<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">
|
||||
<small data-i18n="Last User Prefix">Last User Prefix</small>
|
||||
<textarea id="instruct_last_input_sequence" data-macros class="text_pole wide100p textarea_compact autoSetHeight"></textarea>
|
||||
</div>
|
||||
|
||||
+1
-1
@@ -4718,7 +4718,7 @@ export async function Generate(type, { automatic_trigger, force_name2, quiet_pro
|
||||
chat2[i] = formatMessageHistoryItem(coreChat[j], isInstruct, force_output_sequence.FIRST);
|
||||
}
|
||||
|
||||
if (lastUserMessageIndex >= 0 && j === lastUserMessageIndex && isInstruct) {
|
||||
if (lastUserMessageIndex >= 0 && j === lastUserMessageIndex && isInstruct && !isImpersonate) {
|
||||
// Reformat with the last input sequence (if any)
|
||||
chat2[i] = formatMessageHistoryItem(coreChat[j], isInstruct, force_output_sequence.LAST);
|
||||
}
|
||||
|
||||
@@ -597,7 +597,7 @@ export function formatInstructModePrompt(name, isImpersonate, promptBias, name1,
|
||||
function getSequence() {
|
||||
// User impersonation prompt
|
||||
if (isImpersonate) {
|
||||
return instruct.input_sequence;
|
||||
return instruct.last_input_sequence || instruct.input_sequence;
|
||||
}
|
||||
|
||||
// Neutral / system / quiet prompt
|
||||
|
||||
Reference in New Issue
Block a user