Merge pull request #3948 from InspectorCaracal/patch-3 Adds a check for jailbreaks existing in new TC PHI

5fa64361c24f868a914055ea0c87cb808a92e35d

Cohee <18619528+Cohee1207@users.noreply.github.com>

Signed
1 files changed, +3 -0Showing whitespace changes
public/script.js+3 -0
@@ -4214,6 +4214,8 @@ export async function Generate(type, { automatic_trigger, force_name2, quiet_pro
42144214 ? substituteParams(jailbreak, name1, name2, (power_user.sysprompt.post_history ?? ''))
42154215 : baseChatReplace(power_user.sysprompt.post_history, name1, name2);
42164216
4217+ // Only inject the jb if there is one
4218+ if (jailbreak) {
42174219 // When continuing generation of previous output, last user message precedes the message to continue
42184220 if (isContinue) {
42194221 coreChat.splice(coreChat.length - 1, 0, { mes: jailbreak, is_user: true });
@@ -4222,6 +4224,7 @@ export async function Generate(type, { automatic_trigger, force_name2, quiet_pro
42224224 coreChat.push({ mes: jailbreak, is_user: true });
42234225 }
42244226 }
4227+ }
42254228
42264229 let chat2 = [];
42274230 let continue_mag = '';