From b4529e75c6adafd9f66fd138799675ff411d88f8 Mon Sep 17 00:00:00 2001 From: Cohee <18619528+Cohee1207@users.noreply.github.com> Date: Tue, 1 Oct 2024 13:16:55 +0300 Subject: [PATCH] Don't wrap empty sysprompts in instruct mode --- public/scripts/instruct-mode.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/public/scripts/instruct-mode.js b/public/scripts/instruct-mode.js index 033f5c3e8..ba641935f 100644 --- a/public/scripts/instruct-mode.js +++ b/public/scripts/instruct-mode.js @@ -384,6 +384,10 @@ export function formatInstructModeChat(name, mes, isUser, isNarrator, forceAvata * @returns {string} Formatted instruct mode system prompt. */ export function formatInstructModeSystemPrompt(systemPrompt) { + if (!systemPrompt) { + return ''; + } + const separator = power_user.instruct.wrap ? '\n' : ''; if (power_user.instruct.system_sequence_prefix) {