Merge pull request #1012 from StefanDanielSchwarz/llama-2-chat-instruct-preset-fixes

Llama 2 chat instruct preset fixes
This commit is contained in:
Cohee
2023-08-24 22:51:55 +03:00
committed by GitHub
3 changed files with 10 additions and 5 deletions

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);
} else {
return power_user.instruct.system_sequence + separator + systemPrompt;
}
}
return systemPrompt;