From 9bef5c1f90fb134210c86c59d5903ac06a2582b4 Mon Sep 17 00:00:00 2001 From: ebolam Date: Thu, 13 Oct 2022 14:16:02 -0400 Subject: [PATCH] Moved experimental features to a backend variable --- gensettings.py | 16 ++++++++++++++++ koboldai_settings.py | 1 + static/koboldai.css | 4 ++++ static/koboldai.js | 15 --------------- templates/settings flyout.html | 11 ----------- templates/story flyout.html | 2 +- 6 files changed, 22 insertions(+), 27 deletions(-) diff --git a/gensettings.py b/gensettings.py index 8043f2a5..3923e4f5 100644 --- a/gensettings.py +++ b/gensettings.py @@ -552,6 +552,22 @@ gensettingstf = [ "classname": "system", "name": "keep_img_gen_in_memory" }, + { + "UI_V2_Only": True, + "uitype": "toggle", + "unit": "bool", + "label": "Experimental Items", + "id": "experimental_features", + "min": 0, + "max": 1, + "step": 1, + "default": 0, + "tooltip": "When enabled experemental features will be shown in the UI.", + "menu_path": "Interface", + "sub_path": "UI", + "classname": "system", + "name": "experimental_features" + }, ] gensettingsik =[{ diff --git a/koboldai_settings.py b/koboldai_settings.py index 03e04b46..c45c8f97 100644 --- a/koboldai_settings.py +++ b/koboldai_settings.py @@ -1047,6 +1047,7 @@ class system_settings(settings): self.summary_tokenizer = None self.keep_img_gen_in_memory = False self.cookies = {} #cookies for colab since colab's URL changes, cookies are lost + self.experimental_features = False @dataclass class _inference_config: diff --git a/static/koboldai.css b/static/koboldai.css index b5426edf..2b94873e 100644 --- a/static/koboldai.css +++ b/static/koboldai.css @@ -2721,3 +2721,7 @@ input[type='range'] { select { outline: none; } + +[system_experimental_features="false"] { + display: none; +} \ No newline at end of file diff --git a/static/koboldai.js b/static/koboldai.js index a59f2144..2008536b 100644 --- a/static/koboldai.js +++ b/static/koboldai.js @@ -2479,20 +2479,6 @@ function save_preset() { } //--------------------------------------------General UI Functions------------------------------------ -function enable_experemental_features(checked) { - if (checked) { - setCookie("enable_experemental_features", "true"); - for (item of document.getElementsByClassName("experemental")) { - item.classList.remove("hidden"); - } - } else { - setCookie("enable_experemental_features", "false"); - for (item of document.getElementsByClassName("experemental")) { - item.classList.add("hidden"); - } - } -} - function set_font_size(element) { new_font_size = element.value; var r = document.querySelector(':root'); @@ -4441,7 +4427,6 @@ function process_cookies() { } else if (getCookie("options_on_right") == "true") { options_on_right(true); } - enable_experemental_features((getCookie("enable_experemental_features", "false") == "true")); Change_Theme(getCookie("theme", "Monochrome")); diff --git a/templates/settings flyout.html b/templates/settings flyout.html index 64fed5f6..9c742d73 100644 --- a/templates/settings flyout.html +++ b/templates/settings flyout.html @@ -295,17 +295,6 @@ 0.1 2 -
- - Experimental Features:  help_icon - - - - - - - -

expand_more Formatting

diff --git a/templates/story flyout.html b/templates/story flyout.html index a74a384f..c416f36e 100644 --- a/templates/story flyout.html +++ b/templates/story flyout.html @@ -13,7 +13,7 @@
-