Presets: Add power user setting support

Settings such as adding character name, stopping strings, etc can be
preset specific. This change is mainly inspired because people (like myself)
often forget to change these settings after switching a preset, which
can cause weird responses from the model.

Signed-off-by: kingbri <bdashore3@proton.me>
This commit is contained in:
kingbri
2023-10-20 01:56:17 -04:00
parent 5c6343e85e
commit 6e4236d5ee
2 changed files with 59 additions and 12 deletions

View File

@@ -18,7 +18,7 @@ import {
import { groups, selected_group } from "./group-chats.js";
import { instruct_presets } from "./instruct-mode.js";
import { kai_settings } from "./kai-settings.js";
import { context_presets, power_user } from "./power-user.js";
import { context_presets, getContextSettings, power_user } from "./power-user.js";
import {
textgenerationwebui_preset_names,
textgenerationwebui_presets,
@@ -104,6 +104,7 @@ class PresetManager {
async updatePreset() {
const selected = $(this.select).find("option:selected");
console.log(selected)
if (selected.val() == 'gui') {
toastr.info('Cannot update GUI preset');
@@ -236,7 +237,7 @@ class PresetManager {
case "textgenerationwebui":
return textgenerationwebui_settings;
case "context":
const context_preset = structuredClone(power_user.context);
const context_preset = getContextSettings();
context_preset['name'] = name || power_user.context.preset;
return context_preset;
case "instruct":