diff --git a/gensettings.py b/gensettings.py index 9f1e7c43..e5ad10a4 100644 --- a/gensettings.py +++ b/gensettings.py @@ -2,7 +2,7 @@ gensettingstf = [ { "uitype": "slider", "unit": "int", - "label": "Amount to Generate", + "label": "Output Length", "id": "setoutput", "min": 16, "max": 512, @@ -32,7 +32,7 @@ gensettingstf = [ { "uitype": "slider", "unit": "float", - "label": "Top p Sampling", + "label": "Top P Sampling", "id": "settopp", "min": 0.0, "max": 1.0, @@ -48,7 +48,7 @@ gensettingstf = [ { "uitype": "slider", "unit": "int", - "label": "Top k Sampling", + "label": "Top K Sampling", "id": "settopk", "min": 0, "max": 100, @@ -63,7 +63,7 @@ gensettingstf = [ { "uitype": "slider", "unit": "float", - "label": "Tail-free Sampling", + "label": "Tail Free Sampling", "id": "settfs", "min": 0.0, "max": 1.0, @@ -93,7 +93,7 @@ gensettingstf = [ { "uitype": "slider", "unit": "float", - "label": "Top a Sampling", + "label": "Top A Sampling", "id": "settopa", "min": 0.0, "max": 1.0, @@ -123,7 +123,7 @@ gensettingstf = [ { "uitype": "slider", "unit": "int", - "label": "Rep Penalty Range", + "label": "Rep Pen Range", "id": "setreppenrange", "min": 0, "max": 4096, @@ -138,7 +138,7 @@ gensettingstf = [ { "uitype": "slider", "unit": "float", - "label": "Rep Penalty Slope", + "label": "Rep Pen Slope", "id": "setreppenslope", "min": 0.0, "max": 10.0, @@ -153,7 +153,7 @@ gensettingstf = [ { "uitype": "slider", "unit": "int", - "label": "Max Tokens", + "label": "Context Tokens", "id": "settknmax", "min": 512, "max": 2048, @@ -183,7 +183,7 @@ gensettingstf = [ { "uitype": "slider", "unit": "int", - "label": "W Info Depth", + "label": "WI Depth", "id": "setwidepth", "min": 1, "max": 5, @@ -213,7 +213,7 @@ gensettingstf = [ { "uitype": "toggle", "unit": "bool", - "label": "Always Add Prompt", + "label": "Add Prompt", "id": "setuseprompt", "min": 0, "max": 1, @@ -273,7 +273,7 @@ gensettingstf = [ { "uitype": "toggle", "unit": "bool", - "label": "No Prompt Generation", + "label": "No Prompt Gen", "id": "setnopromptgen", "min": 0, "max": 1, @@ -372,7 +372,7 @@ gensettingstf = [ { "uitype": "toggle", "unit": "bool", - "label": "Probability Calc", + "label": "Token Probabilities", "id": "setshowprobs", "min": 0, "max": 1, @@ -387,7 +387,7 @@ gensettingstf = [ { "uitype": "toggle", "unit": "bool", - "label": "Alt Text Generation", + "label": "Alt Text Gen", "id": "alttextgen", "min": 0, "max": 1, @@ -403,7 +403,7 @@ gensettingstf = [ "UI_V2_Only": True, "uitype": "toggle", "unit": "bool", - "label": "Trim incomplete sentences", + "label": "Trim Sentences", "id": "frmttriminc", "min": 0, "max": 1, @@ -419,7 +419,7 @@ gensettingstf = [ "UI_V2_Only": True, "uitype": "toggle", "unit": "bool", - "label": "Remove blank lines", + "label": "No Blank Lines", "id": "frmtrmblln", "min": 0, "max": 1, @@ -435,7 +435,7 @@ gensettingstf = [ "UI_V2_Only": True, "uitype": "toggle", "unit": "bool", - "label": "Remove special characters", + "label": "No Special Chars", "id": "frmtrmspch", "min": 0, "max": 1, @@ -451,7 +451,7 @@ gensettingstf = [ "UI_V2_Only": True, "uitype": "toggle", "unit": "bool", - "label": "Automatic spacing", + "label": "Auto Spacing", "id": "frmtadsnsp", "min": 0, "max": 1, @@ -499,7 +499,7 @@ gensettingsik =[{ { "uitype": "slider", "unit": "float", - "label": "Top p Sampling", + "label": "Top P Sampling", "id": "settopp", "min": 0.0, "max": 1.0, @@ -514,7 +514,7 @@ gensettingsik =[{ { "uitype": "slider", "unit": "int", - "label": "Top k Sampling", + "label": "Top K Sampling", "id": "settopk", "min": 0, "max": 100, @@ -529,7 +529,7 @@ gensettingsik =[{ { "uitype": "slider", "unit": "float", - "label": "Tail-free Sampling", + "label": "Tail Free Sampling", "id": "settfs", "min": 0.0, "max": 1.0, @@ -544,7 +544,7 @@ gensettingsik =[{ { "uitype": "slider", "unit": "int", - "label": "Amount to Generate", + "label": "Output Length", "id": "setikgen", "min": 50, "max": 3000, @@ -559,7 +559,7 @@ gensettingsik =[{ { "uitype": "slider", "unit": "int", - "label": "W Info Depth", + "label": "WI Depth", "id": "setwidepth", "min": 1, "max": 5, @@ -587,7 +587,7 @@ gensettingsik =[{ { "uitype": "toggle", "unit": "bool", - "label": "Always Add Prompt", + "label": "Add Prompt", "id": "setuseprompt", "min": 0, "max": 1, @@ -629,7 +629,7 @@ gensettingsik =[{ { "uitype": "toggle", "unit": "bool", - "label": "No Prompt Generation", + "label": "No Prompt Gen", "id": "setnopromptgen", "min": 0, "max": 1, @@ -685,7 +685,7 @@ gensettingsik =[{ { "uitype": "toggle", "unit": "bool", - "label": "Probability Calculation", + "label": "Token Probabilities", "id": "setshowprobs", "min": 0, "max": 1, @@ -700,7 +700,7 @@ gensettingsik =[{ { "uitype": "toggle", "unit": "bool", - "label": "Alt Text Generation", + "label": "Alt Text Gen", "id": "alttextgen", "min": 0, "max": 1, @@ -716,7 +716,7 @@ gensettingsik =[{ "UI_V2_Only": True, "uitype": "toggle", "unit": "bool", - "label": "Trim incomplete sentences", + "label": "Trim Sentences", "id": "frmttriminc", "min": 0, "max": 1, @@ -732,7 +732,7 @@ gensettingsik =[{ "UI_V2_Only": True, "uitype": "toggle", "unit": "bool", - "label": "Remove blank lines", + "label": "No Blank Lines", "id": "frmtrmblln", "min": 0, "max": 1, @@ -748,7 +748,7 @@ gensettingsik =[{ "UI_V2_Only": True, "uitype": "toggle", "unit": "bool", - "label": "Remove special characters", + "label": "No Special Chars", "id": "frmtrmspch", "min": 0, "max": 1, @@ -764,7 +764,7 @@ gensettingsik =[{ "UI_V2_Only": True, "uitype": "toggle", "unit": "bool", - "label": "Automatic spacing", + "label": "Auto Spacing", "id": "frmtadsnsp", "min": 0, "max": 1, diff --git a/static/koboldai.js b/static/koboldai.js index c11215ef..f95e3281 100644 --- a/static/koboldai.js +++ b/static/koboldai.js @@ -1295,12 +1295,55 @@ function world_info_entry(data) { if ("wpp" in data) { wpp_name.value = data.wpp.name; } - if (data.wpp == undefined) { - do_wpp_attributes(null, world_info_wpp_area, data.uid); - } else { - do_wpp_attributes(data.wpp, world_info_wpp_area, data.uid); - + if (data.wpp != null) { + for (attribute of data.wpp.attributes) { + attribute_area = document.createElement("div"); + label = document.createElement("span"); + label.textContent = "Attribute: "; + attribute_area.append(label); + input = document.createElement("input"); + input.value = attribute.attribute; + input.setAttribute("uid", data.uid); + input.setAttribute("attribute", attribute.attribute); + input.onchange = function() {do_wpp(this.parentElement.parentElement)}; + attribute_area.append(input); + world_info_wpp_area.append(attribute_area); + for (value of attribute.values) { + value_area = document.createElement("div"); + label = document.createElement("span"); + label.textContent = " Value: "; + value_area.append(label); + input = document.createElement("input"); + input.onchange = function() {do_wpp(this.parentElement.parentElement)}; + input.value = value; + input.setAttribute("uid", data.uid); + input.setAttribute("attribute", attribute.attribute); + value_area.append(input); + world_info_wpp_area.append(value_area); + } + value_area = document.createElement("div"); + label = document.createElement("span"); + label.textContent = " Value: "; + value_area.append(label); + input = document.createElement("input"); + input.setAttribute("uid", data.uid); + input.setAttribute("attribute", attribute.attribute); + input.onchange = function() {do_wpp(this.parentElement.parentElement)}; + value_area.append(input); + world_info_wpp_area.append(value_area); + } } + attribute_area = document.createElement("div"); + label = document.createElement("span"); + label.textContent = "Attribute: "; + attribute_area.append(label); + input = document.createElement("input"); + input.value = ""; + input.setAttribute("uid", data.uid); + input.setAttribute("attribute", ""); + input.onchange = function() {do_wpp(this.parentElement.parentElement)}; + attribute_area.append(input); + world_info_wpp_area.append(attribute_area); @@ -1532,46 +1575,8 @@ function show_error_message(data) { error_message_box.querySelector("#popup_list_area").textContent = data; } -function do_wpp_attributes(wpp, world_info_wpp_area, uid) { - table = document.createElement("table"); - if (wpp != null) { - for (attribute of wpp.attributes) { - tr = document.createElement("tr"); - td = document.createElement("td"); - input = document.createElement("input"); - input.value = attribute.attribute; - input.setAttribute("uid", uid); - input.setAttribute("attribute", attribute.attribute); - td.append(input); - tr.append(td); - for (value of attribute.values) { - td = document.createElement("td"); - input = document.createElement("input"); - input.value = attribute.attribute; - input.setAttribute("uid", uid); - input.setAttribute("attribute", attribute.attribute); - td.append(input); - tr.append(td); - } - td = document.createElement("td"); - input = document.createElement("input"); - input.setAttribute("uid", uid); - input.setAttribute("attribute", attribute.attribute); - input.value = ""; - td.append(input); - tr.append(td); - table.append(tr); - } - } - tr = document.createElement("tr"); - td = document.createElement("td"); - input = document.createElement("input"); - input.setAttribute("uid", uid); - input.setAttribute("attribute", ""); - td.append(input); - tr.append(td); - table.append(tr); - world_info_wpp_area.append(table); +function do_wpp(wpp_area) { + console.log(wpp_area); } //--------------------------------------------UI to Server Functions---------------------------------- diff --git a/templates/settings flyout.html b/templates/settings flyout.html index 6e55ff8e..afffe037 100644 --- a/templates/settings flyout.html +++ b/templates/settings flyout.html @@ -105,16 +105,16 @@
- Sample Order: help_icon + Samplers Order: help_icon
    -
  • Top-k Sampling
  • -
  • Top-a Sampling
  • -
  • Top-p Sampling
  • -
  • Tail-free Sampling
  • +
  • Top K Sampling
  • +
  • Top A Sampling
  • +
  • Top P Sampling
  • +
  • Tail Free Sampling
  • Typical Sampling
  • Temperature
@@ -203,7 +203,7 @@ {% endwith %}
- Maximize Game Text Space:  help_icon + Max Game Screen:  help_icon @@ -214,7 +214,7 @@
- Keep options on Right: help_icon + Options on Right: help_icon