Setting Text Changes

This commit is contained in:
ebolam
2022-08-22 18:07:03 -04:00
parent 92205298ad
commit 2187ef2d9e
3 changed files with 87 additions and 82 deletions

View File

@@ -2,7 +2,7 @@ gensettingstf = [
{ {
"uitype": "slider", "uitype": "slider",
"unit": "int", "unit": "int",
"label": "Amount to Generate", "label": "Output Length",
"id": "setoutput", "id": "setoutput",
"min": 16, "min": 16,
"max": 512, "max": 512,
@@ -32,7 +32,7 @@ gensettingstf = [
{ {
"uitype": "slider", "uitype": "slider",
"unit": "float", "unit": "float",
"label": "Top p Sampling", "label": "Top P Sampling",
"id": "settopp", "id": "settopp",
"min": 0.0, "min": 0.0,
"max": 1.0, "max": 1.0,
@@ -48,7 +48,7 @@ gensettingstf = [
{ {
"uitype": "slider", "uitype": "slider",
"unit": "int", "unit": "int",
"label": "Top k Sampling", "label": "Top K Sampling",
"id": "settopk", "id": "settopk",
"min": 0, "min": 0,
"max": 100, "max": 100,
@@ -63,7 +63,7 @@ gensettingstf = [
{ {
"uitype": "slider", "uitype": "slider",
"unit": "float", "unit": "float",
"label": "Tail-free Sampling", "label": "Tail Free Sampling",
"id": "settfs", "id": "settfs",
"min": 0.0, "min": 0.0,
"max": 1.0, "max": 1.0,
@@ -93,7 +93,7 @@ gensettingstf = [
{ {
"uitype": "slider", "uitype": "slider",
"unit": "float", "unit": "float",
"label": "Top a Sampling", "label": "Top A Sampling",
"id": "settopa", "id": "settopa",
"min": 0.0, "min": 0.0,
"max": 1.0, "max": 1.0,
@@ -123,7 +123,7 @@ gensettingstf = [
{ {
"uitype": "slider", "uitype": "slider",
"unit": "int", "unit": "int",
"label": "Rep Penalty Range", "label": "Rep Pen Range",
"id": "setreppenrange", "id": "setreppenrange",
"min": 0, "min": 0,
"max": 4096, "max": 4096,
@@ -138,7 +138,7 @@ gensettingstf = [
{ {
"uitype": "slider", "uitype": "slider",
"unit": "float", "unit": "float",
"label": "Rep Penalty Slope", "label": "Rep Pen Slope",
"id": "setreppenslope", "id": "setreppenslope",
"min": 0.0, "min": 0.0,
"max": 10.0, "max": 10.0,
@@ -153,7 +153,7 @@ gensettingstf = [
{ {
"uitype": "slider", "uitype": "slider",
"unit": "int", "unit": "int",
"label": "Max Tokens", "label": "Context Tokens",
"id": "settknmax", "id": "settknmax",
"min": 512, "min": 512,
"max": 2048, "max": 2048,
@@ -183,7 +183,7 @@ gensettingstf = [
{ {
"uitype": "slider", "uitype": "slider",
"unit": "int", "unit": "int",
"label": "W Info Depth", "label": "WI Depth",
"id": "setwidepth", "id": "setwidepth",
"min": 1, "min": 1,
"max": 5, "max": 5,
@@ -213,7 +213,7 @@ gensettingstf = [
{ {
"uitype": "toggle", "uitype": "toggle",
"unit": "bool", "unit": "bool",
"label": "Always Add Prompt", "label": "Add Prompt",
"id": "setuseprompt", "id": "setuseprompt",
"min": 0, "min": 0,
"max": 1, "max": 1,
@@ -273,7 +273,7 @@ gensettingstf = [
{ {
"uitype": "toggle", "uitype": "toggle",
"unit": "bool", "unit": "bool",
"label": "No Prompt Generation", "label": "No Prompt Gen",
"id": "setnopromptgen", "id": "setnopromptgen",
"min": 0, "min": 0,
"max": 1, "max": 1,
@@ -372,7 +372,7 @@ gensettingstf = [
{ {
"uitype": "toggle", "uitype": "toggle",
"unit": "bool", "unit": "bool",
"label": "Probability Calc", "label": "Token Probabilities",
"id": "setshowprobs", "id": "setshowprobs",
"min": 0, "min": 0,
"max": 1, "max": 1,
@@ -387,7 +387,7 @@ gensettingstf = [
{ {
"uitype": "toggle", "uitype": "toggle",
"unit": "bool", "unit": "bool",
"label": "Alt Text Generation", "label": "Alt Text Gen",
"id": "alttextgen", "id": "alttextgen",
"min": 0, "min": 0,
"max": 1, "max": 1,
@@ -403,7 +403,7 @@ gensettingstf = [
"UI_V2_Only": True, "UI_V2_Only": True,
"uitype": "toggle", "uitype": "toggle",
"unit": "bool", "unit": "bool",
"label": "Trim incomplete sentences", "label": "Trim Sentences",
"id": "frmttriminc", "id": "frmttriminc",
"min": 0, "min": 0,
"max": 1, "max": 1,
@@ -419,7 +419,7 @@ gensettingstf = [
"UI_V2_Only": True, "UI_V2_Only": True,
"uitype": "toggle", "uitype": "toggle",
"unit": "bool", "unit": "bool",
"label": "Remove blank lines", "label": "No Blank Lines",
"id": "frmtrmblln", "id": "frmtrmblln",
"min": 0, "min": 0,
"max": 1, "max": 1,
@@ -435,7 +435,7 @@ gensettingstf = [
"UI_V2_Only": True, "UI_V2_Only": True,
"uitype": "toggle", "uitype": "toggle",
"unit": "bool", "unit": "bool",
"label": "Remove special characters", "label": "No Special Chars",
"id": "frmtrmspch", "id": "frmtrmspch",
"min": 0, "min": 0,
"max": 1, "max": 1,
@@ -451,7 +451,7 @@ gensettingstf = [
"UI_V2_Only": True, "UI_V2_Only": True,
"uitype": "toggle", "uitype": "toggle",
"unit": "bool", "unit": "bool",
"label": "Automatic spacing", "label": "Auto Spacing",
"id": "frmtadsnsp", "id": "frmtadsnsp",
"min": 0, "min": 0,
"max": 1, "max": 1,
@@ -499,7 +499,7 @@ gensettingsik =[{
{ {
"uitype": "slider", "uitype": "slider",
"unit": "float", "unit": "float",
"label": "Top p Sampling", "label": "Top P Sampling",
"id": "settopp", "id": "settopp",
"min": 0.0, "min": 0.0,
"max": 1.0, "max": 1.0,
@@ -514,7 +514,7 @@ gensettingsik =[{
{ {
"uitype": "slider", "uitype": "slider",
"unit": "int", "unit": "int",
"label": "Top k Sampling", "label": "Top K Sampling",
"id": "settopk", "id": "settopk",
"min": 0, "min": 0,
"max": 100, "max": 100,
@@ -529,7 +529,7 @@ gensettingsik =[{
{ {
"uitype": "slider", "uitype": "slider",
"unit": "float", "unit": "float",
"label": "Tail-free Sampling", "label": "Tail Free Sampling",
"id": "settfs", "id": "settfs",
"min": 0.0, "min": 0.0,
"max": 1.0, "max": 1.0,
@@ -544,7 +544,7 @@ gensettingsik =[{
{ {
"uitype": "slider", "uitype": "slider",
"unit": "int", "unit": "int",
"label": "Amount to Generate", "label": "Output Length",
"id": "setikgen", "id": "setikgen",
"min": 50, "min": 50,
"max": 3000, "max": 3000,
@@ -559,7 +559,7 @@ gensettingsik =[{
{ {
"uitype": "slider", "uitype": "slider",
"unit": "int", "unit": "int",
"label": "W Info Depth", "label": "WI Depth",
"id": "setwidepth", "id": "setwidepth",
"min": 1, "min": 1,
"max": 5, "max": 5,
@@ -587,7 +587,7 @@ gensettingsik =[{
{ {
"uitype": "toggle", "uitype": "toggle",
"unit": "bool", "unit": "bool",
"label": "Always Add Prompt", "label": "Add Prompt",
"id": "setuseprompt", "id": "setuseprompt",
"min": 0, "min": 0,
"max": 1, "max": 1,
@@ -629,7 +629,7 @@ gensettingsik =[{
{ {
"uitype": "toggle", "uitype": "toggle",
"unit": "bool", "unit": "bool",
"label": "No Prompt Generation", "label": "No Prompt Gen",
"id": "setnopromptgen", "id": "setnopromptgen",
"min": 0, "min": 0,
"max": 1, "max": 1,
@@ -685,7 +685,7 @@ gensettingsik =[{
{ {
"uitype": "toggle", "uitype": "toggle",
"unit": "bool", "unit": "bool",
"label": "Probability Calculation", "label": "Token Probabilities",
"id": "setshowprobs", "id": "setshowprobs",
"min": 0, "min": 0,
"max": 1, "max": 1,
@@ -700,7 +700,7 @@ gensettingsik =[{
{ {
"uitype": "toggle", "uitype": "toggle",
"unit": "bool", "unit": "bool",
"label": "Alt Text Generation", "label": "Alt Text Gen",
"id": "alttextgen", "id": "alttextgen",
"min": 0, "min": 0,
"max": 1, "max": 1,
@@ -716,7 +716,7 @@ gensettingsik =[{
"UI_V2_Only": True, "UI_V2_Only": True,
"uitype": "toggle", "uitype": "toggle",
"unit": "bool", "unit": "bool",
"label": "Trim incomplete sentences", "label": "Trim Sentences",
"id": "frmttriminc", "id": "frmttriminc",
"min": 0, "min": 0,
"max": 1, "max": 1,
@@ -732,7 +732,7 @@ gensettingsik =[{
"UI_V2_Only": True, "UI_V2_Only": True,
"uitype": "toggle", "uitype": "toggle",
"unit": "bool", "unit": "bool",
"label": "Remove blank lines", "label": "No Blank Lines",
"id": "frmtrmblln", "id": "frmtrmblln",
"min": 0, "min": 0,
"max": 1, "max": 1,
@@ -748,7 +748,7 @@ gensettingsik =[{
"UI_V2_Only": True, "UI_V2_Only": True,
"uitype": "toggle", "uitype": "toggle",
"unit": "bool", "unit": "bool",
"label": "Remove special characters", "label": "No Special Chars",
"id": "frmtrmspch", "id": "frmtrmspch",
"min": 0, "min": 0,
"max": 1, "max": 1,
@@ -764,7 +764,7 @@ gensettingsik =[{
"UI_V2_Only": True, "UI_V2_Only": True,
"uitype": "toggle", "uitype": "toggle",
"unit": "bool", "unit": "bool",
"label": "Automatic spacing", "label": "Auto Spacing",
"id": "frmtadsnsp", "id": "frmtadsnsp",
"min": 0, "min": 0,
"max": 1, "max": 1,

View File

@@ -1295,12 +1295,55 @@ function world_info_entry(data) {
if ("wpp" in data) { if ("wpp" in data) {
wpp_name.value = data.wpp.name; wpp_name.value = data.wpp.name;
} }
if (data.wpp == undefined) { if (data.wpp != null) {
do_wpp_attributes(null, world_info_wpp_area, data.uid); for (attribute of data.wpp.attributes) {
} else { attribute_area = document.createElement("div");
do_wpp_attributes(data.wpp, world_info_wpp_area, data.uid); 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; error_message_box.querySelector("#popup_list_area").textContent = data;
} }
function do_wpp_attributes(wpp, world_info_wpp_area, uid) { function do_wpp(wpp_area) {
table = document.createElement("table"); console.log(wpp_area);
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);
} }
//--------------------------------------------UI to Server Functions---------------------------------- //--------------------------------------------UI to Server Functions----------------------------------

View File

@@ -105,16 +105,16 @@
<div class="setting_container_single"> <div class="setting_container_single">
<!---Top Row----> <!---Top Row---->
<span class="setting_label"> <span class="setting_label">
<span>Sample Order:&nbsp;</span><span class="helpicon material-icons-outlined" title="Help Text Here">help_icon</span> <span>Samplers Order:&nbsp;</span><span class="helpicon material-icons-outlined" title="Help Text Here">help_icon</span>
</span> </span>
<!---Bottom Row----> <!---Bottom Row---->
<span class="setting_item"> <span class="setting_item">
<div style="display:flex;flex-direction:row;"> <div style="display:flex;flex-direction:row;">
<ul id="sample_order_list" style="width:calc(var(--flyout_menu_width) - 60px);list-style-position: inside; padding: 0;"> <ul id="sample_order_list" style="width:calc(var(--flyout_menu_width) - 60px);list-style-position: inside; padding: 0;">
<li class="sample_order cursor" onclick="select_sample(this);">Top-k Sampling</li> <li class="sample_order cursor" onclick="select_sample(this);">Top K Sampling</li>
<li class="sample_order cursor" onclick="select_sample(this);">Top-a Sampling</li> <li class="sample_order cursor" onclick="select_sample(this);">Top A Sampling</li>
<li class="sample_order cursor" onclick="select_sample(this);">Top-p Sampling</li> <li class="sample_order cursor" onclick="select_sample(this);">Top P Sampling</li>
<li class="sample_order cursor" onclick="select_sample(this);">Tail-free Sampling</li> <li class="sample_order cursor" onclick="select_sample(this);">Tail Free Sampling</li>
<li class="sample_order cursor" onclick="select_sample(this);">Typical Sampling</li> <li class="sample_order cursor" onclick="select_sample(this);">Typical Sampling</li>
<li class="sample_order cursor" onclick="select_sample(this);">Temperature</li> <li class="sample_order cursor" onclick="select_sample(this);">Temperature</li>
</ul> </ul>
@@ -203,7 +203,7 @@
{% endwith %} {% endwith %}
<div class="setting_container"> <div class="setting_container">
<span class="setting_label"> <span class="setting_label">
<span>Maximize Game Text Space: &nbsp;</span><span class="helpicon material-icons-outlined" title="When enabled and both menus are un-pinned, the game screen will take up all avaialable space. When disabled, the game screen will be centered.">help_icon</span> <span>Max Game Screen: &nbsp;</span><span class="helpicon material-icons-outlined" title="When enabled and both menus are un-pinned, the game screen will take up all avaialable space. When disabled, the game screen will be centered.">help_icon</span>
</span> </span>
<span class="setting_item"> <span class="setting_item">
<input type=checkbox id="preserve_game_space_setting" data-size=mini data-onstyle=success data-toggle=toggle onchange="preserve_game_space(this.checked)"/> <input type=checkbox id="preserve_game_space_setting" data-size=mini data-onstyle=success data-toggle=toggle onchange="preserve_game_space(this.checked)"/>
@@ -214,7 +214,7 @@
</div> </div>
<div class="setting_container"> <div class="setting_container">
<span class="setting_label"> <span class="setting_label">
<span>Keep options on Right:&nbsp;</span><span class="helpicon material-icons-outlined" title="When enabled and only the story menu is pinned, the generated story options will be shown on the right instead of the left of the game text.">help_icon</span> <span>Options on Right:&nbsp;</span><span class="helpicon material-icons-outlined" title="When enabled and only the story menu is pinned, the generated story options will be shown on the right instead of the left of the game text.">help_icon</span>
</span> </span>
<span class="setting_item"> <span class="setting_item">
<input type=checkbox id="options_on_right" data-size=mini data-onstyle=success data-toggle=toggle onchange="options_on_right(this.checked)"/> <input type=checkbox id="options_on_right" data-size=mini data-onstyle=success data-toggle=toggle onchange="options_on_right(this.checked)"/>