From d5959a4681481582640b78c4c73a0a3208a6421f Mon Sep 17 00:00:00 2001 From: Cohee <18619528+Cohee1207@users.noreply.github.com> Date: Sat, 8 Feb 2025 19:13:05 +0200 Subject: [PATCH 1/7] Add awaits to event emissions --- public/script.js | 12 ++++++------ public/scripts/power-user.js | 2 +- public/scripts/textgen-settings.js | 4 ++-- public/scripts/world-info.js | 2 +- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/public/script.js b/public/script.js index 753262ac9..b5b161555 100644 --- a/public/script.js +++ b/public/script.js @@ -3514,7 +3514,7 @@ export async function generateRaw(prompt, api, instructOverride, quietToLoud, sy break; } case 'textgenerationwebui': - generateData = getTextGenGenerationData(prompt, amount_gen, false, false, null, 'quiet'); + generateData = await getTextGenGenerationData(prompt, amount_gen, false, false, null, 'quiet'); TempResponseLength.restore(api); break; case 'openai': { @@ -4651,7 +4651,7 @@ export async function Generate(type, { automatic_trigger, force_name2, quiet_pro break; case 'textgenerationwebui': { const cfgValues = useCfgPrompt ? { guidanceScale: cfgGuidanceScale, negativePrompt: await getCombinedPrompt(true) } : null; - generate_data = getTextGenGenerationData(finalPrompt, maxLength, isImpersonate, isContinue, cfgValues, type); + generate_data = await getTextGenGenerationData(finalPrompt, maxLength, isImpersonate, isContinue, cfgValues, type); break; } case 'novel': { @@ -6991,7 +6991,7 @@ export async function getSettings() { loadProxyPresets(settings); // Allow subscribers to mutate settings - eventSource.emit(event_types.SETTINGS_LOADED_AFTER, settings); + await eventSource.emit(event_types.SETTINGS_LOADED_AFTER, settings); // Set context size after loading power user (may override the max value) $('#max_context').val(max_context); @@ -7051,7 +7051,7 @@ export async function getSettings() { } await validateDisabledSamplers(); settingsReady = true; - eventSource.emit(event_types.SETTINGS_LOADED); + await eventSource.emit(event_types.SETTINGS_LOADED); } function selectKoboldGuiPreset() { @@ -11468,7 +11468,7 @@ jQuery(async function () { ); break;*/ default: - eventSource.emit('charManagementDropdown', target); + await eventSource.emit('charManagementDropdown', target); } $('#char-management-dropdown').prop('selectedIndex', 0); }); @@ -11630,7 +11630,7 @@ jQuery(async function () { $(document).on('click', '.open_characters_library', async function () { await getCharacters(); - eventSource.emit(event_types.OPEN_CHARACTER_LIBRARY); + await eventSource.emit(event_types.OPEN_CHARACTER_LIBRARY); }); // Added here to prevent execution before script.js is loaded and get rid of quirky timeouts diff --git a/public/scripts/power-user.js b/public/scripts/power-user.js index 8d90b24f6..66b298954 100644 --- a/public/scripts/power-user.js +++ b/public/scripts/power-user.js @@ -2451,7 +2451,7 @@ async function resetMovablePanels(type) { } saveSettingsDebounced(); - eventSource.emit(event_types.MOVABLE_PANELS_RESET); + await eventSource.emit(event_types.MOVABLE_PANELS_RESET); eventSource.once(event_types.SETTINGS_UPDATED, () => { $('.resizing').removeClass('resizing'); diff --git a/public/scripts/textgen-settings.js b/public/scripts/textgen-settings.js index 29bce0858..50c630841 100644 --- a/public/scripts/textgen-settings.js +++ b/public/scripts/textgen-settings.js @@ -1221,7 +1221,7 @@ function replaceMacrosInList(str) { } } -export function getTextGenGenerationData(finalPrompt, maxTokens, isImpersonate, isContinue, cfgValues, type) { +export async function getTextGenGenerationData(finalPrompt, maxTokens, isImpersonate, isContinue, cfgValues, type) { const canMultiSwipe = !isContinue && !isImpersonate && type !== 'quiet'; const dynatemp = isDynamicTemperatureSupported(); const { banned_tokens, banned_strings } = getCustomTokenBans(); @@ -1449,7 +1449,7 @@ export function getTextGenGenerationData(finalPrompt, maxTokens, isImpersonate, } } - eventSource.emitAndWait(event_types.TEXT_COMPLETION_SETTINGS_READY, params); + await eventSource.emit(event_types.TEXT_COMPLETION_SETTINGS_READY, params); // Grammar conflicts with with json_schema if (settings.type === LLAMACPP) { diff --git a/public/scripts/world-info.js b/public/scripts/world-info.js index 6f071f84e..2dfb4c869 100644 --- a/public/scripts/world-info.js +++ b/public/scripts/world-info.js @@ -3452,7 +3452,7 @@ async function _save(name, data) { headers: getRequestHeaders(), body: JSON.stringify({ name: name, data: data }), }); - eventSource.emit(event_types.WORLDINFO_UPDATED, name, data); + await eventSource.emit(event_types.WORLDINFO_UPDATED, name, data); } From 98ea463e0e549c31b7968f0f86eb443f96581d98 Mon Sep 17 00:00:00 2001 From: Cohee <18619528+Cohee1207@users.noreply.github.com> Date: Sat, 8 Feb 2025 21:18:46 +0200 Subject: [PATCH 2/7] Update layout of Reasoning settings block --- public/index.html | 79 ++++++++++++++++++++++++++--------------------- public/style.css | 2 ++ 2 files changed, 46 insertions(+), 35 deletions(-) diff --git a/public/index.html b/public/index.html index 82ab25778..26a8f1adf 100644 --- a/public/index.html +++ b/public/index.html @@ -3750,7 +3750,7 @@ @@ -3797,44 +3797,53 @@ Reasoning
- - - -
-
- Prefix - -
-
- Suffix - +
+ + +
+
+ +
+ + Max
-
-
- Separator - +
+ + Reasoning Formatting + +
+
+ Prefix + +
+
+ Suffix + +
-
- Max Additions - +
+
+ Separator + +
-
+
diff --git a/public/style.css b/public/style.css index e026b73de..a0943d540 100644 --- a/public/style.css +++ b/public/style.css @@ -5746,11 +5746,13 @@ body:not(.movingUI) .drawer-content.maximized { overflow-wrap: anywhere; } +#SystemPromptColumn summary, #InstructSequencesColumn summary { font-size: 0.95em; cursor: pointer; } +#SystemPromptColumn details, #InstructSequencesColumn details:not(:last-of-type) { margin-bottom: 5px; } From f83dccda3913cb91362ac55788c01ea359984255 Mon Sep 17 00:00:00 2001 From: Cohee <18619528+Cohee1207@users.noreply.github.com> Date: Sat, 8 Feb 2025 21:56:54 +0200 Subject: [PATCH 3/7] Mark 'Extras' option as deprecated in built-in extensions --- public/scripts/extensions/caption/settings.html | 2 +- public/scripts/extensions/expressions/settings.html | 2 +- public/scripts/extensions/memory/settings.html | 2 +- public/scripts/extensions/stable-diffusion/settings.html | 2 +- public/scripts/extensions/vectors/settings.html | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/public/scripts/extensions/caption/settings.html b/public/scripts/extensions/caption/settings.html index 2dab71817..d379e03c8 100644 --- a/public/scripts/extensions/caption/settings.html +++ b/public/scripts/extensions/caption/settings.html @@ -10,7 +10,7 @@
diff --git a/public/scripts/extensions/expressions/settings.html b/public/scripts/extensions/expressions/settings.html index dc22debbd..e7a737a6b 100644 --- a/public/scripts/extensions/expressions/settings.html +++ b/public/scripts/extensions/expressions/settings.html @@ -23,7 +23,7 @@ Select the API for classifying expressions. diff --git a/public/scripts/extensions/memory/settings.html b/public/scripts/extensions/memory/settings.html index 40a58a905..262dd6715 100644 --- a/public/scripts/extensions/memory/settings.html +++ b/public/scripts/extensions/memory/settings.html @@ -12,7 +12,7 @@
diff --git a/public/scripts/extensions/stable-diffusion/settings.html b/public/scripts/extensions/stable-diffusion/settings.html index e1ae810c6..7969ef7e2 100644 --- a/public/scripts/extensions/stable-diffusion/settings.html +++ b/public/scripts/extensions/stable-diffusion/settings.html @@ -41,7 +41,7 @@ - + diff --git a/public/scripts/extensions/vectors/settings.html b/public/scripts/extensions/vectors/settings.html index 613217289..343850f4e 100644 --- a/public/scripts/extensions/vectors/settings.html +++ b/public/scripts/extensions/vectors/settings.html @@ -11,7 +11,7 @@ - + Replace Macro in Stop Strings diff --git a/public/locales/ar-sa.json b/public/locales/ar-sa.json index 46f8a2805..c0bc382f1 100644 --- a/public/locales/ar-sa.json +++ b/public/locales/ar-sa.json @@ -482,7 +482,7 @@ "separate with commas w/o space between": "فصل بفواصل دون مسافة بينها", "Custom Stopping Strings": "سلاسل توقف مخصصة", "JSON serialized array of strings": "مصفوفة سلسلة JSON متسلسلة", - "Replace Macro in Custom Stopping Strings": "استبدال الماكرو في سلاسل التوقف المخصصة", + "Replace Macro in Stop Strings": "استبدال الماكرو في سلاسل التوقف المخصصة", "Auto-Continue": "المتابعة التلقائية", "Allow for Chat Completion APIs": "السماح بواجهات برمجة التطبيقات لإكمال الدردشة", "Target length (tokens)": "الطول المستهدف (رموز)", diff --git a/public/locales/de-de.json b/public/locales/de-de.json index a10d80e0b..d1ba2fb0b 100644 --- a/public/locales/de-de.json +++ b/public/locales/de-de.json @@ -482,7 +482,7 @@ "separate with commas w/o space between": "getrennt durch Kommas ohne Leerzeichen dazwischen", "Custom Stopping Strings": "Benutzerdefinierte Stoppzeichenfolgen", "JSON serialized array of strings": "JSON serialisierte Reihe von Zeichenfolgen", - "Replace Macro in Custom Stopping Strings": "Makro in benutzerdefinierten Stoppzeichenfolgen ersetzen", + "Replace Macro in Stop Strings": "Makro in benutzerdefinierten Stoppzeichenfolgen ersetzen", "Auto-Continue": "Automatisch fortsetzen", "Allow for Chat Completion APIs": "Erlaube Chat-Vervollständigungs-APIs", "Target length (tokens)": "Ziel-Länge (Tokens)", diff --git a/public/locales/es-es.json b/public/locales/es-es.json index 334a283b3..5794c1e7f 100644 --- a/public/locales/es-es.json +++ b/public/locales/es-es.json @@ -482,7 +482,7 @@ "separate with commas w/o space between": "separe con comas sin espacio entre ellas", "Custom Stopping Strings": "Cadenas de Detención Personalizadas", "JSON serialized array of strings": "Arreglo de cadenas serializado en JSON", - "Replace Macro in Custom Stopping Strings": "Reemplazar macro en Cadenas de Detención Personalizadas", + "Replace Macro in Stop Strings": "Reemplazar macro en Cadenas de Detención Personalizadas", "Auto-Continue": "Autocontinuar", "Allow for Chat Completion APIs": "Permitir para APIs de Completado de Chat", "Target length (tokens)": "Longitud objetivo (tokens)", diff --git a/public/locales/fr-fr.json b/public/locales/fr-fr.json index 8caacde2d..16f10496c 100644 --- a/public/locales/fr-fr.json +++ b/public/locales/fr-fr.json @@ -434,7 +434,7 @@ "Non-markdown strings": "Chaînes non Markdown", "Custom Stopping Strings": "Chaînes d'arrêt personnalisées", "JSON serialized array of strings": "Tableau de chaînes sérialisé JSON", - "Replace Macro in Custom Stopping Strings": "Remplacer les macro dans les chaînes d'arrêt personnalisées", + "Replace Macro in Stop Strings": "Remplacer les macro dans les chaînes d'arrêt personnalisées", "Auto-Continue": "Auto-Continue", "Allow for Chat Completion APIs": "Autoriser les APIs de complétion de chat", "Target length (tokens)": "Longueur cible (tokens)", diff --git a/public/locales/is-is.json b/public/locales/is-is.json index 2cacc1511..4bfc1e7b7 100644 --- a/public/locales/is-is.json +++ b/public/locales/is-is.json @@ -482,7 +482,7 @@ "separate with commas w/o space between": "aðskilið með kommum án bila milli", "Custom Stopping Strings": "Eigin stopp-strengir", "JSON serialized array of strings": "JSON raðað fylki af strengjum", - "Replace Macro in Custom Stopping Strings": "Skiptu út í macro í sérsniðnum stoppa strengjum", + "Replace Macro in Stop Strings": "Skiptu út í macro í sérsniðnum stoppa strengjum", "Auto-Continue": "Sjálfvirk Forná", "Allow for Chat Completion APIs": "Leyfa fyrir spjall Loka APIs", "Target length (tokens)": "Markaðarlengd (texti)", diff --git a/public/locales/it-it.json b/public/locales/it-it.json index eeea5c0fb..e833745b7 100644 --- a/public/locales/it-it.json +++ b/public/locales/it-it.json @@ -482,7 +482,7 @@ "separate with commas w/o space between": "separati con virgole senza spazio tra loro", "Custom Stopping Strings": "Stringhe di Stop Personalizzate", "JSON serialized array of strings": "Matrice serializzata JSON di stringhe", - "Replace Macro in Custom Stopping Strings": "Sostituisci Macro in Stringhe di Arresto Personalizzate", + "Replace Macro in Stop Strings": "Sostituisci Macro in Stringhe di Arresto Personalizzate", "Auto-Continue": "Auto-continua", "Allow for Chat Completion APIs": "Consenti per API di completamento chat", "Target length (tokens)": "Lunghezza obiettivo (token)", diff --git a/public/locales/ja-jp.json b/public/locales/ja-jp.json index 2b3119e6e..b30a77b06 100644 --- a/public/locales/ja-jp.json +++ b/public/locales/ja-jp.json @@ -482,7 +482,7 @@ "separate with commas w/o space between": "間にスペースのないカンマで区切ります", "Custom Stopping Strings": "カスタム停止文字列", "JSON serialized array of strings": "文字列のJSONシリアル化配列", - "Replace Macro in Custom Stopping Strings": "カスタム停止文字列内のマクロを置換する", + "Replace Macro in Stop Strings": "カスタム停止文字列内のマクロを置換する", "Auto-Continue": "自動継続", "Allow for Chat Completion APIs": "チャット補完APIを許可", "Target length (tokens)": "ターゲット長さ(トークン)", diff --git a/public/locales/ko-kr.json b/public/locales/ko-kr.json index 2c2dfca86..0eebca64c 100644 --- a/public/locales/ko-kr.json +++ b/public/locales/ko-kr.json @@ -492,7 +492,7 @@ "separate with commas w/o space between": "쉼표로 구분 (공백 없이)", "Custom Stopping Strings": "사용자 정의 중지 문자열", "JSON serialized array of strings": "문자열의 JSON 직렬화된 배열", - "Replace Macro in Custom Stopping Strings": "사용자 정의 중단 문자열에서 매크로 교체", + "Replace Macro in Stop Strings": "사용자 정의 중단 문자열에서 매크로 교체", "Auto-Continue": "자동 계속하기", "Allow for Chat Completion APIs": "채팅 완성 API 허용", "Target length (tokens)": "대상 길이 (토큰)", diff --git a/public/locales/nl-nl.json b/public/locales/nl-nl.json index c4820f5b8..317447f11 100644 --- a/public/locales/nl-nl.json +++ b/public/locales/nl-nl.json @@ -482,7 +482,7 @@ "separate with commas w/o space between": "gescheiden met komma's zonder spatie ertussen", "Custom Stopping Strings": "Aangepaste Stopreeksen", "JSON serialized array of strings": "JSON geserialiseerde reeks van strings", - "Replace Macro in Custom Stopping Strings": "Macro vervangen in aangepaste stopreeksen", + "Replace Macro in Stop Strings": "Macro vervangen in aangepaste stopreeksen", "Auto-Continue": "Automatisch doorgaan", "Allow for Chat Completion APIs": "Chatvervolledigings-API's toestaan", "Target length (tokens)": "Doellengte (tokens)", diff --git a/public/locales/pt-pt.json b/public/locales/pt-pt.json index 5a2fba569..cea383fcc 100644 --- a/public/locales/pt-pt.json +++ b/public/locales/pt-pt.json @@ -482,7 +482,7 @@ "separate with commas w/o space between": "separe com vírgulas sem espaço entre", "Custom Stopping Strings": "Cadeias de parada personalizadas", "JSON serialized array of strings": "Matriz de strings serializada em JSON", - "Replace Macro in Custom Stopping Strings": "Substituir Macro em Strings de Parada Personalizadas", + "Replace Macro in Stop Strings": "Substituir Macro em Strings de Parada Personalizadas", "Auto-Continue": "Auto-Continuar", "Allow for Chat Completion APIs": "Permitir APIs de Completar Chat", "Target length (tokens)": "Comprimento alvo (tokens)", diff --git a/public/locales/ru-ru.json b/public/locales/ru-ru.json index 4c67beaa9..8693cf7f5 100644 --- a/public/locales/ru-ru.json +++ b/public/locales/ru-ru.json @@ -161,7 +161,7 @@ "View hidden API keys": "Посмотреть скрытые API-ключи", "Advanced Formatting": "Расширенное форматирование", "Context Template": "Шаблон контекста", - "Replace Macro in Custom Stopping Strings": "Заменять макросы в пользовательских стоп-строках", + "Replace Macro in Stop Strings": "Заменять макросы в пользовательских стоп-строках", "Story String": "Строка истории", "Example Separator": "Разделитель примеров сообщений", "Chat Start": "Начало чата", diff --git a/public/locales/uk-ua.json b/public/locales/uk-ua.json index 216ed3928..ba371421d 100644 --- a/public/locales/uk-ua.json +++ b/public/locales/uk-ua.json @@ -482,7 +482,7 @@ "separate with commas w/o space between": "розділяйте комами без пропусків між ними", "Custom Stopping Strings": "Власні рядки зупинки", "JSON serialized array of strings": "JSON-серіалізований масив рядків", - "Replace Macro in Custom Stopping Strings": "Замінювати макроси у власних рядках зупинки", + "Replace Macro in Stop Strings": "Замінювати макроси у власних рядках зупинки", "Auto-Continue": "Автоматичне продовження", "Allow for Chat Completion APIs": "Дозволити для Chat Completion API", "Target length (tokens)": "Цільова довжина (токени)", diff --git a/public/locales/vi-vn.json b/public/locales/vi-vn.json index 36459e94f..f9a24d365 100644 --- a/public/locales/vi-vn.json +++ b/public/locales/vi-vn.json @@ -482,7 +482,7 @@ "separate with commas w/o space between": "phân tách bằng dấu phẩy không có khoảng trắng giữa", "Custom Stopping Strings": "Chuỗi dừng tùy chỉnh", "JSON serialized array of strings": "Mảng chuỗi được tuần tự hóa JSON", - "Replace Macro in Custom Stopping Strings": "Thay thế Macro trong Chuỗi Dừng Tùy chỉnh", + "Replace Macro in Stop Strings": "Thay thế Macro trong Chuỗi Dừng Tùy chỉnh", "Auto-Continue": "Tự động Tiếp tục", "Allow for Chat Completion APIs": "Cho phép các API hoàn thành Trò chuyện", "Target length (tokens)": "Độ dài mục tiêu (token)", diff --git a/public/locales/zh-cn.json b/public/locales/zh-cn.json index 7213669ab..a77a2a792 100644 --- a/public/locales/zh-cn.json +++ b/public/locales/zh-cn.json @@ -559,7 +559,7 @@ "Prompt Content": "提示词内容", "Custom Stopping Strings": "自定义停止字符串", "JSON serialized array of strings": "JSON序列化的字符串数组", - "Replace Macro in Custom Stopping Strings": "替换自定义停止字符串中的宏", + "Replace Macro in Stop Strings": "替换自定义停止字符串中的宏", "Token Padding": "词符填充", "Miscellaneous": "杂项", "Non-markdown strings": "非 Markdown 字符串", diff --git a/public/locales/zh-tw.json b/public/locales/zh-tw.json index 039748265..861af3f4d 100644 --- a/public/locales/zh-tw.json +++ b/public/locales/zh-tw.json @@ -483,7 +483,7 @@ "separate with commas w/o space between": "用逗號分隔,之間無空格", "Custom Stopping Strings": "自訂停止字串", "JSON serialized array of strings": "JSON 序列化字串數組", - "Replace Macro in Custom Stopping Strings": "取代自訂停止字串中的巨集", + "Replace Macro in Stop Strings": "取代自訂停止字串中的巨集", "Auto-Continue": "自動繼續", "Allow for Chat Completion APIs": "允許聊天補全 API", "Target length (tokens)": "目標長度(符元)",