From bfc696fcc452975dbe8967c39301ba856d04a030 Mon Sep 17 00:00:00 2001 From: Concedo <39025047+LostRuins@users.noreply.github.com> Date: Sat, 23 Sep 2023 12:35:23 +0800 Subject: [PATCH] update lite, update ver --- klite.embd | 78 +++++++++++++++++++++++----------------------------- koboldcpp.py | 2 +- 2 files changed, 36 insertions(+), 44 deletions(-) diff --git a/klite.embd b/klite.embd index 036f94d71567d..9a4a31f6aa792 100644 --- a/klite.embd +++ b/klite.embd @@ -6,7 +6,7 @@ It requires no dependencies, installation or setup. Just copy this single static HTML file anywhere and open it in a browser, or from a webserver. Please go to https://github.com/LostRuins/lite.koboldai.net for updates on Kobold Lite. Kobold Lite is under the AGPL v3.0 License for the purposes of koboldcpp. Please do not remove this line. -Current version: 67 +Current version: 68 -Concedo --> @@ -8842,16 +8842,6 @@ Current version: 67 const aestheticTextStyleTypes = ['text', 'speech', 'action']; // One style per speech type. Could add more later I guess. const aestheticTextStyleRoles = ['uniform', 'you', 'AI', 'sys']; // Uniform for when you want all roles use the same styles. - class AestheticTextStyle { - constructor(options) { - options = options || {}; - this.color = options.color || 'rgba(255,255,255, 1)'; - this.fontWeight = options.bold ? 'bold' : 'normal'; - this.fontStyle = options.italic ? 'italic' : 'normal'; - this.opacity = options.opacity || 1; - } - } - class AestheticInstructUISettings { constructor() { this.bubbleColor_sys = 'rgba(20, 40, 40, 0.8)'; @@ -8880,9 +8870,9 @@ Current version: 67 this.use_uniform_colors = true; // Hides 'you, AI, sys' if set to true via settings UI. for (let role of aestheticTextStyleRoles) { - this[`text_color_${role}`] = new AestheticTextStyle({ color: 'rgba(255,255,255,1)'} ); - this[`speech_color_${role}`] = new AestheticTextStyle({ color: 'rgba(150, 150, 200, 1)', italic: true }); - this[`action_color_${role}`] = new AestheticTextStyle({ color: 'rgba(255,255,255, 0.7)', italic: true }); + this[`text_tcolor_${role}`] = 'rgba(255,255,255,1)'; + this[`speech_tcolor_${role}`] = 'rgba(150, 150, 200, 1)'; + this[`action_tcolor_${role}`] = 'rgba(255,255,255, 0.7)'; } this.code_block_background = 'black'; @@ -8909,10 +8899,10 @@ Current version: 67 function initializeInstructUIFunctionality() { // Initialize foregroundColorPickers and backgroundColorPickers. - document.querySelectorAll('.enhancedTextColorPicker, .enhancedStandardColorPicker').forEach(element => { + document.querySelectorAll('.enhancedcolorPicker, .enhancedStandardColorPicker').forEach(element => { // Create a fully transparent colorPicker for each element and initialize it as child of the textblock element. // ..this happens because we want the colorPicker to open right below the element. - let useBackground = !element.classList.contains('enhancedTextColorPicker'); + let useBackground = !element.classList.contains('enhancedcolorPicker'); let colorPicker = document.createElement('input'); colorPicker.type = 'color'; colorPicker.style.opacity = '0'; @@ -9034,8 +9024,7 @@ Current version: 67 function deepCopyAestheticSettings(original) { let copy = new AestheticInstructUISettings(); for (let [key, value] of Object.entries(original)) { - if (value instanceof AestheticTextStyle) { copy[key] = new AestheticTextStyle({ color: value.color, bold: value.fontWeight === 'bold', italic: value.fontStyle === 'italic', opacity: value.opacity }); } - else { copy[key] = value; } + copy[key] = value; } return copy; } @@ -9049,7 +9038,7 @@ Current version: 67 function updateDataFromUI() { for (let role of aestheticTextStyleRoles) { for (let type of aestheticTextStyleTypes) { - aestheticInstructUISettings[`${type}_color_${role}`] = getTextStyleFromElement(`${role}-${type}-colorselector`); + aestheticInstructUISettings[`${type}_tcolor_${role}`] = getColorPickerValueFromElement(`${role}-${type}-colorselector`); } if (role != 'uniform') { aestheticInstructUISettings[`bubbleColor_${role}`] = document.getElementById(`${role}-bubble-colorselector`).style.backgroundColor; } } @@ -9077,17 +9066,17 @@ Current version: 67 aestheticInstructUISettings.portrait_ratio_you = cleannum(aestheticInstructUISettings.portrait_ratio_you, 0.01, 3).toFixed(2); aestheticInstructUISettings.background_minHeight = cleannum(aestheticInstructUISettings.background_minHeight, 0, 300); - function getTextStyleFromElement(id) { + function getColorPickerValueFromElement(id) { let element = document.getElementById(id); let computedStyle = window.getComputedStyle(element); - return new AestheticTextStyle({color: computedStyle.color, bold: computedStyle.fontWeight > 400, italic: computedStyle.fontStyle == 'italic', opacity: computedStyle.opacity}); + return computedStyle.color; } } function updateUIFromData() { // Parse color settings and apply to the related parts in the UI. for (let role of aestheticTextStyleRoles) { for (let type of aestheticTextStyleTypes) { - setElementColor(`${role}-${type}-colorselector`, aestheticInstructUISettings[`${type}_color_${role}`]); + setElementColor(`${role}-${type}-colorselector`, aestheticInstructUISettings[`${type}_tcolor_${role}`]); } if (role != 'uniform') { document.getElementById(`${role}-bubble-colorselector`).style.backgroundColor = aestheticInstructUISettings[`bubbleColor_${role}`]; } } @@ -9124,14 +9113,11 @@ Current version: 67 }); - function setElementColor(id, textStyle) { + function setElementColor(id, newColor) { let element = document.getElementById(id); if (!element) { console.warn(`Element with ID: ${id} not found.`); return; } - element.style.color = textStyle.color; - element.style.opacity = textStyle.opacity; - element.style.fontWeight = textStyle.fontWeight; - element.style.fontStyle = textStyle.fontStyle; + element.style.color = newColor; } function showOrHide(classID, value) { if (value) { document.querySelectorAll(classID).forEach((x) => x.classList.remove('hidden')); } @@ -9208,8 +9194,14 @@ Current version: 67 // Helper functions to allow styling the chat log properly. These affect both the background of the chat bubbles and its content. - function style(role) { return `${contextDict.closeTag}
${image(role)}
${contextDict[`${role}Open`]}`; } - function wrapperSpan(role, type) { let textStyle = as[`${type}_color_${role}`]; return `$1`; } + function style(role) { + return `${contextDict.closeTag}
${image(role)}
${contextDict[`${role}Open`]}`; + } + function wrapperSpan(role, type) { + let fontStyle = type=='action'?'italic':'normal'; + let injectQuotes = type=='speech'?'"':''; + let textCol = as[`${type}_tcolor_${role}`]; return `${injectQuotes}$1${injectQuotes}`; + } function image(role) { if (!as[`${role}_portrait`] || as.border_style == 'None' || role == 'sys') { return ''; } return `
`; @@ -10407,32 +10399,32 @@ Current version: 67
Colors:
-
text🖌️
-
"speech"🖌️
-
*action*🖌️
+
text🖌️
+
"speech"🖌️
+
*action*🖌️
You:
-
text🖌️
-
"speech"🖌️
-
*action*🖌️
+
text🖌️
+
"speech"🖌️
+
*action*🖌️
AI:
-
text🖌️
-
"speech"🖌️
-
*action*🖌️
+
text🖌️
+
"speech"🖌️
+
*action*🖌️
System:
-
text🖌️
-
"speech"🖌️
-
*action*🖌️
+
text🖌️
+
"speech"🖌️
+
*action*🖌️
Code blocks:
-
background🖌️
-
foreground🖌️
+
background🖌️
+
foreground🖌️

diff --git a/koboldcpp.py b/koboldcpp.py index ea9e26276dbee..67fa9544142c0 100755 --- a/koboldcpp.py +++ b/koboldcpp.py @@ -354,7 +354,7 @@ def utfprint(str): modelbusy = threading.Lock() requestsinqueue = 0 defaultport = 5001 -KcppVersion = "1.44.1" +KcppVersion = "1.44.2" showdebug = True showsamplerwarning = True showmaxctxwarning = True