More formatting options

This commit is contained in:
SillyLossy
2023-04-16 17:26:08 +03:00
parent b2d8510b87
commit 269bd69d7c
3 changed files with 37 additions and 11 deletions

View File

@ -1475,7 +1475,8 @@ async function Generate(type, automatic_trigger, force_name2) {
if (!storyString.endsWith('\n')) {
storyString += '\n';
}
example = example.replace(/<START>/i, 'This is how ' + name2 + ' should talk');//An example of how '+name2+' responds
const replaceString = power_user.disable_examples_formatting ? `This is how ${name2} should talk` : '';
example = example.replace(/<START>/i, replaceString);
}
storyString += appendToStoryString(example, '');
}
@ -1617,6 +1618,10 @@ async function Generate(type, automatic_trigger, force_name2) {
const prompt = JSON.stringify(worldInfoString + storyString + mesExmString + chatString + anchorTop + anchorBottom + charPersonality + promptBias + allAnchors);
const tokenCount = getTokenCount(prompt, padding_tokens);
if (tokenCount < this_max_context) {
if (power_user.disable_examples_formatting) {
mesExamplesArray[iii] = mesExamplesArray[iii].replace(/<START>/i, '');
}
if (!is_pygmalion) {
mesExamplesArray[iii] = mesExamplesArray[iii].replace(/<START>/i, `This is how ${name2} should talk`);
}
@ -1773,6 +1778,10 @@ async function Generate(type, automatic_trigger, force_name2) {
if (power_user.custom_chat_separator && power_user.custom_chat_separator.length) {
mesSendString = power_user.custom_chat_separator + '\n' + mesSendString;
}
// if chat start formatting is disabled
else if (power_user.disable_start_formatting) {
mesSendString = mesSendString;
}
// add non-pygma dingus
else if (!is_pygmalion) {
mesSendString = '\nThen the roleplay chat between ' + name1 + ' and ' + name2 + ' begins.\n' + mesSendString;