Fix OpenAI itemizer for characters with example dialogues

This commit is contained in:
Cohee
2023-07-14 22:52:17 +03:00
parent f931932d31
commit 37de77b20d
2 changed files with 4 additions and 2 deletions

View File

@@ -3215,7 +3215,8 @@ function promptItemize(itemizedPrompts, requestedMesId) {
//charDescriptionTokens + //charDescriptionTokens +
//charPersonalityTokens + //charPersonalityTokens +
//allAnchorsTokens + //allAnchorsTokens +
//worldInfoStringTokens + worldInfoStringTokens +
afterScenarioAnchorTokens +
examplesStringTokens; examplesStringTokens;
// OAI doesn't use padding // OAI doesn't use padding
thisPrompt_padding = 0; thisPrompt_padding = 0;
@@ -3246,7 +3247,7 @@ function promptItemize(itemizedPrompts, requestedMesId) {
if (this_main_api == 'openai') { if (this_main_api == 'openai') {
//console.log('-- applying % on OAI tokens'); //console.log('-- applying % on OAI tokens');
var oaiStartTokensPercentage = ((oaiStartTokens / (finalPromptTokens)) * 100).toFixed(2); var oaiStartTokensPercentage = ((oaiStartTokens / (finalPromptTokens)) * 100).toFixed(2);
var storyStringTokensPercentage = ((oaiPromptTokens / (finalPromptTokens)) * 100).toFixed(2); var storyStringTokensPercentage = (((examplesStringTokens + afterScenarioAnchorTokens + oaiPromptTokens) / (finalPromptTokens)) * 100).toFixed(2);
var ActualChatHistoryTokensPercentage = ((ActualChatHistoryTokens / (finalPromptTokens)) * 100).toFixed(2); var ActualChatHistoryTokensPercentage = ((ActualChatHistoryTokens / (finalPromptTokens)) * 100).toFixed(2);
var promptBiasTokensPercentage = ((oaiBiasTokens / (finalPromptTokens)) * 100).toFixed(2); var promptBiasTokensPercentage = ((oaiBiasTokens / (finalPromptTokens)) * 100).toFixed(2);
var worldInfoStringTokensPercentage = ((worldInfoStringTokens / (finalPromptTokens)) * 100).toFixed(2); var worldInfoStringTokensPercentage = ((worldInfoStringTokens / (finalPromptTokens)) * 100).toFixed(2);

View File

@@ -2717,6 +2717,7 @@ input[type="range"]::-webkit-slider-thumb {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
row-gap: 5px; row-gap: 5px;
flex-grow: 1;
} }
#anchor_checkbox label, #anchor_checkbox label,