Don't wrap empty sysprompts in instruct mode

b4529e75c6adafd9f66fd138799675ff411d88f8

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

1 files changed, +4 -0Showing whitespace changes
public/scripts/instruct-mode.js+4 -0
@@ -384,6 +384,10 @@ export function formatInstructModeChat(name, mes, isUser, isNarrator, forceAvata
384384 * @returns {string} Formatted instruct mode system prompt.
385385 */
386386export function formatInstructModeSystemPrompt(systemPrompt) {
387+ if (!systemPrompt) {
388+ return '';
389+ }
390+
387391 const separator = power_user.instruct.wrap ? '\n' : '';
388392
389393 if (power_user.instruct.system_sequence_prefix) {