system prompt in system sequence

This commit is contained in:
Stefan Daniel Schwarz 2023-08-24 19:33:04 +02:00
parent 582464a2e7
commit 56a6398189
2 changed files with 8 additions and 3 deletions

View File

@ -1,10 +1,10 @@
{
"name": "Llama 2 Chat",
"system_prompt": "[INST] <<SYS>>\nWrite {{char}}'s next reply in this fictional roleplay with {{user}}.\n<</SYS>>\n",
"system_prompt": "Write {{char}}'s next reply in this fictional roleplay with {{user}}.",
"input_sequence": "[INST] ",
"output_sequence": " [/INST] ",
"last_output_sequence": "",
"system_sequence": "[INST] <<SYS>>\n",
"system_sequence": "[INST] <<SYS>>\n{{sys}}\n<</SYS>>\n",
"stop_sequence": "",
"separator_sequence": "\n",
"wrap": false,

View File

@ -256,7 +256,12 @@ export function formatInstructModeChat(name, mes, isUser, isNarrator, forceAvata
export function formatInstructModeSystemPrompt(systemPrompt){
if (power_user.instruct.system_sequence) {
const separator = power_user.instruct.wrap ? '\n' : '';
return power_user.instruct.system_sequence + separator + systemPrompt;
if (power_user.instruct.system_sequence.includes("{{sys}}")) {
return power_user.instruct.system_sequence.replace(/{{sys}}/gi, systemPrompt) + separator;
} else {
return power_user.instruct.system_sequence + separator + systemPrompt;
}
}
return systemPrompt;