From 725aff3474e98bbcf1b6c0014cefbe58de2a5d30 Mon Sep 17 00:00:00 2001
From: Cohee <18619528+Cohee1207@users.noreply.github.com>
Date: Mon, 9 Sep 2024 00:26:06 +0300
Subject: [PATCH 1/8] Display API and model used in itemization
---
public/script.js | 16 ++++++++++++++--
public/scripts/templates/itemizationChat.html | 2 +-
public/scripts/templates/itemizationText.html | 2 +-
3 files changed, 16 insertions(+), 4 deletions(-)
diff --git a/public/script.js b/public/script.js
index 29f5c5ce6..dc50a6e69 100644
--- a/public/script.js
+++ b/public/script.js
@@ -4941,7 +4941,7 @@ async function duplicateCharacter() {
return '';
}
-export async function itemizedParams(itemizedPrompts, thisPromptSet) {
+export async function itemizedParams(itemizedPrompts, thisPromptSet, incomingMesId) {
const params = {
charDescriptionTokens: await getTokenCountAsync(itemizedPrompts[thisPromptSet].charDescription),
charPersonalityTokens: await getTokenCountAsync(itemizedPrompts[thisPromptSet].charPersonality),
@@ -4960,8 +4960,20 @@ export async function itemizedParams(itemizedPrompts, thisPromptSet) {
chatInjects: await getTokenCountAsync(itemizedPrompts[thisPromptSet].chatInjects),
chatVectorsStringTokens: await getTokenCountAsync(itemizedPrompts[thisPromptSet].chatVectorsString),
dataBankVectorsStringTokens: await getTokenCountAsync(itemizedPrompts[thisPromptSet].dataBankVectorsString),
+ modelUsed: chat[incomingMesId]?.extra?.model,
+ apiUsed: chat[incomingMesId]?.extra?.api,
};
+ const getFriendlyName = (value) => $(`#rm_api_block select option[value="${value}"]`).first().text() || value;
+
+ if (params.apiUsed) {
+ params.apiUsed = getFriendlyName(params.apiUsed);
+ }
+
+ if (params.this_main_api) {
+ params.mainApiFriendlyName = getFriendlyName(params.this_main_api);
+ }
+
if (params.chatInjects) {
params.ActualChatHistoryTokens = params.ActualChatHistoryTokens - params.chatInjects;
}
@@ -5076,7 +5088,7 @@ async function promptItemize(itemizedPrompts, requestedMesId) {
return null;
}
- const params = await itemizedParams(itemizedPrompts, thisPromptSet);
+ const params = await itemizedParams(itemizedPrompts, thisPromptSet, incomingMesId);
const flatten = (rawPrompt) => Array.isArray(rawPrompt) ? rawPrompt.map(x => x.content).join('\n') : rawPrompt;
const template = params.this_main_api == 'openai'
diff --git a/public/scripts/templates/itemizationChat.html b/public/scripts/templates/itemizationChat.html
index ea1390d4f..038cdaf40 100644
--- a/public/scripts/templates/itemizationChat.html
+++ b/public/scripts/templates/itemizationChat.html
@@ -4,8 +4,8 @@
+API/Model Used: {{mainApiFriendlyName}} {{#if apiUsed}}({{apiUsed}}){{/if}} {{#if modelUsed}}– {{modelUsed}}{{/if}}
Tokenizer: {{selectedTokenizer}}
-API Used: {{this_main_api}}
Only the white numbers really matter. All numbers are estimates.
Grey color items may not have been included in the context due to certain prompt format settings.
diff --git a/public/scripts/templates/itemizationText.html b/public/scripts/templates/itemizationText.html
index 1f986083b..1fbf46959 100644
--- a/public/scripts/templates/itemizationText.html
+++ b/public/scripts/templates/itemizationText.html
@@ -4,8 +4,8 @@
+API/Model Used: {{mainApiFriendlyName}} {{#if apiUsed}}({{apiUsed}}){{/if}} {{#if modelUsed}}– {{modelUsed}}{{/if}}
Tokenizer: {{selectedTokenizer}}
-API Used: {{this_main_api}}
Only the white numbers really matter. All numbers are estimates.
Grey color items may not have been included in the context due to certain prompt format settings.
From daeef9407dd23639f97d0a4ae4966d433ff49041 Mon Sep 17 00:00:00 2001
From: RossAscends <124905043+RossAscends@users.noreply.github.com>
Date: Mon, 9 Sep 2024 11:29:04 +0900
Subject: [PATCH 2/8] fix sampler select color highlights
---
public/scripts/samplerSelect.js | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/public/scripts/samplerSelect.js b/public/scripts/samplerSelect.js
index 72f9f6ccf..c949b8e91 100644
--- a/public/scripts/samplerSelect.js
+++ b/public/scripts/samplerSelect.js
@@ -13,8 +13,8 @@ import { setting_names } from './textgen-settings.js';
const TGsamplerNames = setting_names;
-const forcedOnColoring = 'filter: sepia(1) hue-rotate(59deg) contrast(1.5) saturate(3.5)';
-const forcedOffColoring = 'filter: sepia(1) hue-rotate(308deg) contrast(0.7) saturate(10)';
+const forcedOnColoring = 'color: #89db35;';
+const forcedOffColoring = 'color: #e84f62;';
let userDisabledSamplers, userShownSamplers;
From 58d17d4bd971d579f87b764d1211f642f4c78caa Mon Sep 17 00:00:00 2001
From: RossAscends <124905043+RossAscends@users.noreply.github.com>
Date: Mon, 9 Sep 2024 12:36:58 +0900
Subject: [PATCH 3/8] prettily support more than 999 swipes
---
public/style.css | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/public/style.css b/public/style.css
index 91726dd63..7e3374f5d 100644
--- a/public/style.css
+++ b/public/style.css
@@ -993,6 +993,7 @@ body .panelControlBar {
padding: 0;
font-family: var(--mainFontFamily);
font-weight: 400;
+ align-self: self-end;
}
.swipe_left {
@@ -5458,4 +5459,4 @@ body:not(.movingUI) .drawer-content.maximized {
#AdvancedFormatting .autoSetHeight {
overflow-wrap: anywhere;
-}
+}
\ No newline at end of file
From 448af33b4d195ee531fe983dd56cdc3db2775184 Mon Sep 17 00:00:00 2001
From: I
Date: Mon, 9 Sep 2024 00:17:19 -0400
Subject: [PATCH 4/8] Update script.js - fixes group chat this_chid being set
twice in character edit panel
---
public/script.js | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/public/script.js b/public/script.js
index dc50a6e69..5800d24d1 100644
--- a/public/script.js
+++ b/public/script.js
@@ -3412,7 +3412,7 @@ export async function Generate(type, { automatic_trigger, force_name2, quiet_pro
.filter((index) => index !== undefined && index !== null);
if (memberIds.length > 0) {
- setCharacterId(memberIds[0]);
+ if (menu_type != 'character_edit') setCharacterId(memberIds[0]);
setCharacterName('');
} else {
console.log('No enabled members found');
From 0109242f856ed22f9ba2e8c3590818bb9375451c Mon Sep 17 00:00:00 2001
From: RossAscends <124905043+RossAscends@users.noreply.github.com>
Date: Mon, 9 Sep 2024 17:13:26 +0900
Subject: [PATCH 5/8] OCD-havers rejoice
---
public/index.html | 20 ++++++++++----------
1 file changed, 10 insertions(+), 10 deletions(-)
diff --git a/public/index.html b/public/index.html
index c949839d8..e27322dc6 100644
--- a/public/index.html
+++ b/public/index.html
@@ -65,7 +65,7 @@