From 0faa7d3c758bdee35e98d4bd6197092110d38cfc Mon Sep 17 00:00:00 2001 From: Cohee <18619528+Cohee1207@users.noreply.github.com> Date: Thu, 18 Apr 2024 23:15:24 +0300 Subject: [PATCH] Replace {{name}} macro in system prompt prefix --- public/scripts/instruct-mode.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/public/scripts/instruct-mode.js b/public/scripts/instruct-mode.js index ba1b1506e..3837cd7eb 100644 --- a/public/scripts/instruct-mode.js +++ b/public/scripts/instruct-mode.js @@ -354,7 +354,9 @@ export function formatInstructModeSystemPrompt(systemPrompt) { const separator = power_user.instruct.wrap ? '\n' : ''; if (power_user.instruct.system_sequence_prefix) { - systemPrompt = power_user.instruct.system_sequence_prefix + separator + systemPrompt; + // TODO: Replace with a proper 'System' prompt entity name input + const prefix = power_user.instruct.system_sequence_prefix.replace(/{{name}}/gi, 'System'); + systemPrompt = prefix + separator + systemPrompt; } if (power_user.instruct.system_sequence_suffix) {