diff --git a/public/img/circle-chevron-down-solid.svg b/public/img/circle-chevron-down-solid.svg new file mode 100644 index 000000000..18c6bcb02 --- /dev/null +++ b/public/img/circle-chevron-down-solid.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/public/img/circle-chevron-up-solid.svg b/public/img/circle-chevron-up-solid.svg new file mode 100644 index 000000000..a4a718e45 --- /dev/null +++ b/public/img/circle-chevron-up-solid.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/public/index.html b/public/index.html index 51888c355..b74baf671 100644 --- a/public/index.html +++ b/public/index.html @@ -46,6 +46,7 @@ + Tavern.AI @@ -542,6 +543,80 @@ min="0" max="2048" step="1"> +
+
+

Advanced Settings

+
+
+
+
+
+

Top P Sampling

+
+
+
select
+
+
+ +
+
+
+
+

Top A Sampling

+
+
+
select
+
+
+ +
+
+
+
+

Top K Sampling

+
+
+
select
+
+
+ +
+
+
+
+

Typical Sampling

+
+
+
select
+
+
+ +
+
+
+
+

Tail Free Sampling

+
+
+
select
+
+
+ +
+
+
+
+

Repetition Penalty Slope

+
+
+
select
+
+
+ +
+
+
+

Soft Prompt

diff --git a/public/script.js b/public/script.js index 107ede82c..38d4dd9f4 100644 --- a/public/script.js +++ b/public/script.js @@ -1,6 +1,11 @@ import { humanizedDateTime } from "./scripts/RossAscends-mods.js"; import { encode, decode } from "../scripts/gpt-2-3-tokenizer/mod.js"; +import { + kai_settings, + loadKoboldSettings, +} from "./scripts/kai-settings.js"; + import { world_info_budget, world_info_data, @@ -37,6 +42,7 @@ export { Generate, getSettings, saveSettings, + saveSettingsDebounced, printMessages, clearChat, getChat, @@ -1370,13 +1376,13 @@ async function Generate(type, automatic_trigger) {//encode("dsfs").length max_length: this_amount_gen,//parseInt(amount_gen), rep_pen: parseFloat(rep_pen), rep_pen_range: parseInt(rep_pen_size), - rep_pen_slope: this_settings.rep_pen_slope, + rep_pen_slope: kai_settings.rep_pen_slope, temperature: parseFloat(temp), - tfs: this_settings.tfs, - top_a: this_settings.top_a, - top_k: this_settings.top_k, - top_p: this_settings.top_p, - typical: this_settings.typical, + tfs: kai_settings.tfs, + top_a: kai_settings.top_a, + top_k: kai_settings.top_k, + top_p: kai_settings.top_p, + typical: kai_settings.typical, s1: this_settings.sampler_order[0], s2: this_settings.sampler_order[1], s3: this_settings.sampler_order[2], @@ -2045,6 +2051,8 @@ async function getSettings(type) { //console.log('getsettings calling showswipebtns'); showSwipeButtons(); + loadKoboldSettings(settings); + //Novel temp_novel = settings.temp_novel; rep_pen_novel = settings.rep_pen_novel; @@ -2193,6 +2201,7 @@ async function saveSettings(type) { active_character: active_character, textgenerationwebui_settings: textgenerationwebui_settings, swipes: swipes, + ...kai_settings, }), beforeSend: function () { //console.log('saveSettings() -- active_character -- '+active_character); @@ -3720,31 +3729,29 @@ $(document).ready(function () { $("#settings_perset").change(function () { if ($("#settings_perset").find(":selected").val() != "gui") { preset_settings = $("#settings_perset").find(":selected").text(); - temp = koboldai_settings[koboldai_setting_names[preset_settings]].temp; - amount_gen = - koboldai_settings[koboldai_setting_names[preset_settings]].genamt; - rep_pen = - koboldai_settings[koboldai_setting_names[preset_settings]].rep_pen; - rep_pen_size = - koboldai_settings[koboldai_setting_names[preset_settings]] - .rep_pen_range; - max_context = - koboldai_settings[koboldai_setting_names[preset_settings]].max_length; + const preset = koboldai_settings[koboldai_setting_names[preset_settings]]; + loadKoboldSettings(preset); + + temp = preset.temp; $("#temp").val(temp); $("#temp_counter").html(temp); + amount_gen = preset.genamt; $("#amount_gen").val(amount_gen); $("#amount_gen_counter").html(amount_gen); - $("#max_context").val(max_context); - $("#max_context_counter").html(max_context + " Tokens"); - + rep_pen = preset.rep_pen; $("#rep_pen").val(rep_pen); $("#rep_pen_counter").html(rep_pen); + rep_pen_size = preset.rep_pen_range; $("#rep_pen_size").val(rep_pen_size); $("#rep_pen_size_counter").html(rep_pen_size + " Tokens"); + max_context = preset.max_length; + $("#max_context").val(max_context); + $("#max_context_counter").html(max_context + " Tokens"); + $("#range_block").children().prop("disabled", false); $("#range_block").css("opacity", 1.0); $("#amount_gen_block").children().prop("disabled", false); diff --git a/public/style.css b/public/style.css index 04da316e5..1d405b910 100644 --- a/public/style.css +++ b/public/style.css @@ -2782,4 +2782,36 @@ label[for="extensions_autoconnect"] { .expander { flex-grow: 1; +} + +.drawer { + padding-bottom: 10px; +} + +.drawer-icon { + display: block; + cursor: pointer; + width: 26px; + height: 26px; + background-size: cover; + background-repeat: no-repeat; + filter: invert(1) brightness(75%); +} + +.drawer-icon.up { + background-image: url('img/circle-chevron-up-solid.svg'); +} + +.drawer-icon.down { + background-image: url('img/circle-chevron-down-solid.svg'); +} + +.drawer-header { + display: flex; + justify-content: space-between; + align-items: center; +} + +.drawer-content { + display: none; } \ No newline at end of file