Sampler Order added to UI

This commit is contained in:
ebolam
2022-08-12 21:18:31 -04:00
parent 96f7625190
commit e164af9264
9 changed files with 271 additions and 99 deletions

View File

@@ -6296,6 +6296,8 @@ def UI_2_var_change(data):
value = bool(data['value']) value = bool(data['value'])
elif type(getattr(koboldai_vars, name)) == str: elif type(getattr(koboldai_vars, name)) == str:
value = str(data['value']) value = str(data['value'])
elif type(getattr(koboldai_vars, name)) == list:
value = list(data['value'])
else: else:
print("Unknown Type {} = {}".format(name, type(getattr(koboldai_vars, name)))) print("Unknown Type {} = {}".format(name, type(getattr(koboldai_vars, name))))
@@ -6407,7 +6409,7 @@ def UI_2_redo(data):
koboldai_vars.actions.use_option(0) koboldai_vars.actions.use_option(0)
#==================================================================# #==================================================================#
# Event triggered when user clicks the redo button # Event triggered when user clicks the retry button
#==================================================================# #==================================================================#
@socketio.on('retry') @socketio.on('retry')
def UI_2_retry(data): def UI_2_retry(data):

View File

@@ -9,7 +9,7 @@ gensettingstf = [
"step": 2, "step": 2,
"default": 80, "default": 80,
"tooltip": "Number of tokens the AI should generate. Higher numbers will take longer to generate.", "tooltip": "Number of tokens the AI should generate. Higher numbers will take longer to generate.",
"menu_path": "Model", "menu_path": "Settings",
"sub_path": "Generation", "sub_path": "Generation",
"classname": "model", "classname": "model",
"name": "genamt" "name": "genamt"
@@ -24,7 +24,7 @@ gensettingstf = [
"step": 0.05, "step": 0.05,
"default": 0.5, "default": 0.5,
"tooltip": "Randomness of sampling. High values can increase creativity but may make text less sensible. Lower values will make text more predictable but can become repetitious.", "tooltip": "Randomness of sampling. High values can increase creativity but may make text less sensible. Lower values will make text more predictable but can become repetitious.",
"menu_path": "Model", "menu_path": "Settings",
"sub_path": "Generation", "sub_path": "Generation",
"classname": "model", "classname": "model",
"name": "temp" "name": "temp"
@@ -39,7 +39,7 @@ gensettingstf = [
"step": 0.05, "step": 0.05,
"default": 0.9, "default": 0.9,
"tooltip": "Used to discard unlikely text in the sampling process. Lower values will make text more predictable but can become repetitious. (Put this value on 1 to disable its effect)", "tooltip": "Used to discard unlikely text in the sampling process. Lower values will make text more predictable but can become repetitious. (Put this value on 1 to disable its effect)",
"menu_path": "Model", "menu_path": "Settings",
"sub_path": "Sampling", "sub_path": "Sampling",
"classname": "model", "classname": "model",
"name": "top_p" "name": "top_p"
@@ -55,7 +55,7 @@ gensettingstf = [
"step": 1, "step": 1,
"default": 0, "default": 0,
"tooltip": "Alternative sampling method, can be combined with top_p. (Put this value on 0 to disable its effect)", "tooltip": "Alternative sampling method, can be combined with top_p. (Put this value on 0 to disable its effect)",
"menu_path": "Model", "menu_path": "Settings",
"sub_path": "Sampling", "sub_path": "Sampling",
"classname": "model", "classname": "model",
"name": "top_k" "name": "top_k"
@@ -70,7 +70,7 @@ gensettingstf = [
"step": 0.05, "step": 0.05,
"default": 1.0, "default": 1.0,
"tooltip": "Alternative sampling method; it is recommended to disable top_p and top_k (set top_p to 1 and top_k to 0) if using this. 0.95 is thought to be a good value. (Put this value on 1 to disable its effect)", "tooltip": "Alternative sampling method; it is recommended to disable top_p and top_k (set top_p to 1 and top_k to 0) if using this. 0.95 is thought to be a good value. (Put this value on 1 to disable its effect)",
"menu_path": "Model", "menu_path": "Settings",
"sub_path": "Sampling", "sub_path": "Sampling",
"classname": "model", "classname": "model",
"name": "tfs" "name": "tfs"
@@ -85,7 +85,7 @@ gensettingstf = [
"step": 0.05, "step": 0.05,
"default": 1.0, "default": 1.0,
"tooltip": "Alternative sampling method described in the paper \"Typical Decoding for Natural Language Generation\" (10.48550/ARXIV.2202.00666). The paper suggests 0.2 as a good value for this setting. Set this setting to 1 to disable its effect.", "tooltip": "Alternative sampling method described in the paper \"Typical Decoding for Natural Language Generation\" (10.48550/ARXIV.2202.00666). The paper suggests 0.2 as a good value for this setting. Set this setting to 1 to disable its effect.",
"menu_path": "Model", "menu_path": "Settings",
"sub_path": "Sampling", "sub_path": "Sampling",
"classname": "model", "classname": "model",
"name": "typical" "name": "typical"
@@ -100,7 +100,7 @@ gensettingstf = [
"step": 0.01, "step": 0.01,
"default": 0.0, "default": 0.0,
"tooltip": "Alternative sampling method that reduces the randomness of the AI whenever the probability of one token is much higher than all the others. Higher values have a stronger effect. Set this setting to 0 to disable its effect.", "tooltip": "Alternative sampling method that reduces the randomness of the AI whenever the probability of one token is much higher than all the others. Higher values have a stronger effect. Set this setting to 0 to disable its effect.",
"menu_path": "Model", "menu_path": "Settings",
"sub_path": "Sampling", "sub_path": "Sampling",
"classname": "model", "classname": "model",
"name": "top_a" "name": "top_a"
@@ -115,7 +115,7 @@ gensettingstf = [
"step": 0.01, "step": 0.01,
"default": 1.1, "default": 1.1,
"tooltip": "Used to penalize words that were already generated or belong to the context (Going over 1.2 breaks 6B models).", "tooltip": "Used to penalize words that were already generated or belong to the context (Going over 1.2 breaks 6B models).",
"menu_path": "Model", "menu_path": "Settings",
"sub_path": "Repetition", "sub_path": "Repetition",
"classname": "model", "classname": "model",
"name": "rep_pen" "name": "rep_pen"
@@ -130,7 +130,7 @@ gensettingstf = [
"step": 4, "step": 4,
"default": 0, "default": 0,
"tooltip": "Repetition penalty range. If set higher than 0, only applies repetition penalty to the last few tokens of your story rather than applying it to the entire story. This slider controls the amount of tokens at the end of your story to apply it to.", "tooltip": "Repetition penalty range. If set higher than 0, only applies repetition penalty to the last few tokens of your story rather than applying it to the entire story. This slider controls the amount of tokens at the end of your story to apply it to.",
"menu_path": "Model", "menu_path": "Settings",
"sub_path": "Repetition", "sub_path": "Repetition",
"classname": "model", "classname": "model",
"name": "rep_pen_range" "name": "rep_pen_range"
@@ -145,7 +145,7 @@ gensettingstf = [
"step": 0.1, "step": 0.1,
"default": 0.0, "default": 0.0,
"tooltip": "Repetition penalty slope. If BOTH this setting and Rep Penalty Range are set higher than 0, will use sigmoid interpolation to apply repetition penalty more strongly on tokens that are closer to the end of your story. This setting controls the tension of the sigmoid curve; higher settings will result in the repetition penalty difference between the start and end of your story being more apparent. Setting this to 1 uses linear interpolation; setting this to 0 disables interpolation.", "tooltip": "Repetition penalty slope. If BOTH this setting and Rep Penalty Range are set higher than 0, will use sigmoid interpolation to apply repetition penalty more strongly on tokens that are closer to the end of your story. This setting controls the tension of the sigmoid curve; higher settings will result in the repetition penalty difference between the start and end of your story being more apparent. Setting this to 1 uses linear interpolation; setting this to 0 disables interpolation.",
"menu_path": "Model", "menu_path": "Settings",
"sub_path": "Repetition", "sub_path": "Repetition",
"classname": "model", "classname": "model",
"name": "rep_pen_slope" "name": "rep_pen_slope"
@@ -160,7 +160,7 @@ gensettingstf = [
"step": 8, "step": 8,
"default": 1024, "default": 1024,
"tooltip": "Max number of tokens of context to submit to the AI for sampling. Make sure this is higher than Amount to Generate. Higher values increase VRAM/RAM usage.", "tooltip": "Max number of tokens of context to submit to the AI for sampling. Make sure this is higher than Amount to Generate. Higher values increase VRAM/RAM usage.",
"menu_path": "Model", "menu_path": "Settings",
"sub_path": "Generation", "sub_path": "Generation",
"classname": "model", "classname": "model",
"name": "max_length" "name": "max_length"
@@ -175,7 +175,7 @@ gensettingstf = [
"step": 1, "step": 1,
"default": 1, "default": 1,
"tooltip": "Number of results to generate per submission. Increases VRAM/RAM usage.", "tooltip": "Number of results to generate per submission. Increases VRAM/RAM usage.",
"menu_path": "Model", "menu_path": "Settings",
"sub_path": "Generation", "sub_path": "Generation",
"classname": "model", "classname": "model",
"name": "numseqs" "name": "numseqs"
@@ -190,7 +190,8 @@ gensettingstf = [
"step": 1, "step": 1,
"default": 3, "default": 3,
"tooltip": "Number of historic actions to scan for W Info keys.", "tooltip": "Number of historic actions to scan for W Info keys.",
"menu_path": "User", "menu_path": "World Info",
"sub_path": "",
"classname": "user", "classname": "user",
"name": "widepth" "name": "widepth"
}, },
@@ -204,7 +205,8 @@ gensettingstf = [
"step": 1, "step": 1,
"default": 0, "default": 0,
"tooltip": "Whether the game is saved after each action.", "tooltip": "Whether the game is saved after each action.",
"menu_path": "Story", "menu_path": "Home",
"sub_path": "",
"classname": "story", "classname": "story",
"name": "autosave" "name": "autosave"
}, },
@@ -218,7 +220,8 @@ gensettingstf = [
"step": 1, "step": 1,
"default": 1, "default": 1,
"tooltip": "Whether the prompt should be sent in the context of every action.", "tooltip": "Whether the prompt should be sent in the context of every action.",
"menu_path": "Story", "menu_path": "Settings",
"sub_path": "Other",
"classname": "story", "classname": "story",
"name": "useprompt" "name": "useprompt"
}, },
@@ -233,6 +236,7 @@ gensettingstf = [
"default": 0, "default": 0,
"tooltip": "Turn this on if you are playing a Choose your Adventure model.", "tooltip": "Turn this on if you are playing a Choose your Adventure model.",
#"menu_path": "Story", #"menu_path": "Story",
#"sub_path": "",
#"classname": "story", #"classname": "story",
#"name": "adventure" #"name": "adventure"
}, },
@@ -247,6 +251,7 @@ gensettingstf = [
"default": 0, "default": 0,
"tooltip": "This mode optimizes KoboldAI for chatting.", "tooltip": "This mode optimizes KoboldAI for chatting.",
#"menu_path": "Story", #"menu_path": "Story",
#"sub_path": "",
#"classname": "story", #"classname": "story",
#"name": "chatmode" #"name": "chatmode"
}, },
@@ -260,7 +265,8 @@ gensettingstf = [
"step": 1, "step": 1,
"default": 0, "default": 0,
"tooltip": "Scan the AI's output for world info keys as it's generating the output.", "tooltip": "Scan the AI's output for world info keys as it's generating the output.",
"menu_path": "Story", "menu_path": "World Info",
"sub_path": "",
"classname": "story", "classname": "story",
"name": "dynamicscan" "name": "dynamicscan"
}, },
@@ -274,7 +280,8 @@ gensettingstf = [
"step": 1, "step": 1,
"default": 0, "default": 0,
"tooltip": "When enabled the AI does not generate when you enter the prompt, instead you need to do an action first.", "tooltip": "When enabled the AI does not generate when you enter the prompt, instead you need to do an action first.",
"menu_path": "User", "menu_path": "Settings",
"sub_path": "Other",
"classname": "user", "classname": "user",
"name": "nopromptgen" "name": "nopromptgen"
}, },
@@ -288,7 +295,8 @@ gensettingstf = [
"step": 1, "step": 1,
"default": 0, "default": 0,
"tooltip": "When enabled, the Memory text box in the Random Story dialog will be prefilled by default with your current story's memory instead of being empty.", "tooltip": "When enabled, the Memory text box in the Random Story dialog will be prefilled by default with your current story's memory instead of being empty.",
"menu_path": "User", "menu_path": "Settings",
"sub_path": "Other",
"classname": "user", "classname": "user",
"name": "rngpersist" "name": "rngpersist"
}, },
@@ -302,7 +310,8 @@ gensettingstf = [
"step": 1, "step": 1,
"default": 0, "default": 0,
"tooltip": "Disables userscript generation modifiers.", "tooltip": "Disables userscript generation modifiers.",
"menu_path": "User", "menu_path": "Settings",
"sub_path": "Modifiers",
"classname": "user", "classname": "user",
"name": "nogenmod" "name": "nogenmod"
}, },
@@ -316,7 +325,8 @@ gensettingstf = [
"step": 1, "step": 1,
"default": 0, "default": 0,
"tooltip": "Show debug info", "tooltip": "Show debug info",
"menu_path": "user", "menu_path": "",
"sub_path": "",
"classname": "user", "classname": "user",
"name": "debug" "name": "debug"
}, },
@@ -327,7 +337,8 @@ gensettingstf = [
"id": "actionmode", "id": "actionmode",
"default": 0, "default": 0,
"tooltip": "Choose the mode of KoboldAI", "tooltip": "Choose the mode of KoboldAI",
"menu_path": "Story", "menu_path": "Home",
"sub_path": "",
"classname": "story", "classname": "story",
"name": "actionmode", "name": "actionmode",
'children': [{'text': 'Story', 'value': 0}, {'text':'Adventure','value':1}, {'text':'Chat', 'value':2}] 'children': [{'text': 'Story', 'value': 0}, {'text':'Adventure','value':1}, {'text':'Chat', 'value':2}]
@@ -342,7 +353,8 @@ gensettingstf = [
"step": 1, "step": 1,
"default": 0, "default": 0,
"tooltip": "Shows outputs to you as they are made.", "tooltip": "Shows outputs to you as they are made.",
"menu_path": "User", "menu_path": "Interface",
"sub_path": "UI",
"classname": "user", "classname": "user",
"name": "output_streaming" "name": "output_streaming"
} }

View File

@@ -93,6 +93,7 @@ class koboldai_vars(object):
self._story_settings[story_name] = story_settings(self.socketio) self._story_settings[story_name] = story_settings(self.socketio)
if json_data is not None: if json_data is not None:
self._story_settings[story_name].from_json(json_data) self._story_settings[story_name].from_json(json_data)
self._story_settings['default'].send_to_ui()
def story_list(self): def story_list(self):
return [x for x in self._story_settings] return [x for x in self._story_settings]

View File

@@ -43,6 +43,7 @@
--wi_card_bg_color: #262626; --wi_card_bg_color: #262626;
--wi_card_tag_bg_color: #404040; --wi_card_tag_bg_color: #404040;
--wi_tag_color: #337ab7; --wi_tag_color: #337ab7;
--sample_order_select_color: blue;
--story_options_size: 30%; --story_options_size: 30%;
--story_pinned_areas: "menuicon options gamescreen lefticon" --story_pinned_areas: "menuicon options gamescreen lefticon"
"menuicon inputrow inputrow lefticon"; "menuicon inputrow inputrow lefticon";
@@ -170,6 +171,19 @@
margin: 2px; margin: 2px;
} }
.setting_container_single {
display: grid;
grid-template-areas: "label"
"item";
grid-template-rows: 20px 120px;
grid-template-columns: var(--flyout_menu_width);
row-gap: 0.2em;
background-color: var(--setting_background);
color: var(--text);
margin: 2px;
}
.setting_minlabel { .setting_minlabel {
grid-area: minlabel; grid-area: minlabel;
overflow: hidden; overflow: hidden;
@@ -346,6 +360,10 @@
margin-right: 25px; margin-right: 25px;
} }
.sample_order.selected {
background-color: var(--sample_order_select_color);
}
.presets option { .presets option {
color: var(--dropdown-select); color: var(--dropdown-select);
background: var(--preset-item-background); background: var(--preset-item-background);

View File

@@ -35,6 +35,20 @@ var shift_down = false;
var world_info_data = {}; var world_info_data = {};
var world_info_folder_data = {}; var world_info_folder_data = {};
var saved_settings = {}; var saved_settings = {};
const map1 = new Map()
map1.set('Top-k Sampling', 0)
map1.set('Top-a Sampling', 1)
map1.set('Top-p Sampling', 2)
map1.set('Tail-free Sampling', 3)
map1.set('Typical Sampling', 4)
map1.set('Temperature', 5)
const map2 = new Map()
map2.set(0, 'Top-k Sampling')
map2.set(1, 'Top-a Sampling')
map2.set(2, 'Top-p Sampling')
map2.set(3, 'Tail-free Sampling')
map2.set(4, 'Typical Sampling')
map2.set(5, 'Temperature')
//-----------------------------------Server to UI Functions----------------------------------------------- //-----------------------------------Server to UI Functions-----------------------------------------------
function connect() { function connect() {
console.log("connected"); console.log("connected");
@@ -289,38 +303,39 @@ function do_story_text_length_updates(data) {
} }
function do_presets(data) { function do_presets(data) {
var select = document.getElementById('presets'); for (select of document.getElementsByClassName('presets')) {
//clear out the preset list //clear out the preset list
while (select.firstChild) { while (select.firstChild) {
select.removeChild(select.firstChild); select.removeChild(select.firstChild);
} }
//add our blank option //add our blank option
var option = document.createElement("option"); var option = document.createElement("option");
option.value=""; option.value="";
option.text="presets"; option.text="presets";
select.append(option); select.append(option);
presets = data.value; presets = data.value;
for (const [key, value] of Object.entries(data.value)) { for (const [key, value] of Object.entries(data.value)) {
var option_group = document.createElement("optgroup"); var option_group = document.createElement("optgroup");
option_group.label = key; option_group.label = key;
option_group.classList.add("preset_group"); option_group.classList.add("preset_group");
for (const [group, group_value] of Object.entries(value)) { for (const [group, group_value] of Object.entries(value)) {
var option = document.createElement("option"); var option = document.createElement("option");
option.text=group; option.text=group;
option.disabled = true; option.disabled = true;
option.classList.add("preset_group"); option.classList.add("preset_group");
option_group.append(option); option_group.append(option);
for (const [preset, preset_value] of Object.entries(group_value)) { for (const [preset, preset_value] of Object.entries(group_value)) {
var option = document.createElement("option"); var option = document.createElement("option");
option.value=preset; option.value=preset;
option.text=preset_value.preset; option.text=preset_value.preset;
option.title = preset_value.description; option.title = preset_value.description;
option_group.append(option); option_group.append(option);
} }
}
select.append(option_group);
} }
select.append(option_group);
} }
} }
@@ -372,11 +387,17 @@ function var_changed(data) {
//Special Case for Presets //Special Case for Presets
} else if ((data.classname == 'model') && (data.name == 'presets')) { } else if ((data.classname == 'model') && (data.name == 'presets')) {
do_presets(data); do_presets(data);
//Special Case for prompt
} else if ((data.classname == 'story') && (data.name == 'prompt')) { } else if ((data.classname == 'story') && (data.name == 'prompt')) {
do_prompt(data); do_prompt(data);
//Special Case for phrase biasing //Special Case for phrase biasing
} else if ((data.classname == 'story') && (data.name == 'biases')) { } else if ((data.classname == 'story') && (data.name == 'biases')) {
do_biases(data); do_biases(data);
//Special Case for sample_order
} else if ((data.classname == 'model') && (data.name == 'sampler_order')) {
for (const [index, item] of data.value.entries()) {
Array.from(document.getElementsByClassName("sample_order"))[index].textContent = map2.get(item);
}
//Basic Data Syncing //Basic Data Syncing
} else { } else {
var elements_to_change = document.getElementsByClassName("var_sync_"+data.classname.replace(" ", "_")+"_"+data.name.replace(" ", "_")); var elements_to_change = document.getElementsByClassName("var_sync_"+data.classname.replace(" ", "_")+"_"+data.name.replace(" ", "_"));
@@ -1270,7 +1291,30 @@ function show_error_message(data) {
error_message_box.classList.remove("hidden"); error_message_box.classList.remove("hidden");
error_message_box.querySelector("#popup_list_area").textContent = data; error_message_box.querySelector("#popup_list_area").textContent = data;
} }
//--------------------------------------------UI to Server Functions---------------------------------- //--------------------------------------------UI to Server Functions----------------------------------
function move_sample(direction) {
var previous = null;
console.log(direction);
for (const [index, temp] of Array.from(document.getElementsByClassName("sample_order")).entries()) {
if (temp.classList.contains("selected")) {
if ((direction == 'up') && (index > 0)) {
temp.parentElement.insertBefore(temp, previous);
break;
} else if ((direction == 'down') && (index+1 < Array.from(document.getElementsByClassName("sample_order")).length)) {
temp.parentElement.insertBefore(temp, Array.from(document.getElementsByClassName("sample_order"))[index+2]);
break;
}
}
previous = temp;
}
var sample_order = []
for (item of document.getElementsByClassName("sample_order")) {
sample_order.push(map1.get(item.textContent));
}
socket.emit("var_change", {"ID": 'model_sampler_order', "value": sample_order});
}
function new_story() { function new_story() {
//check if the story is saved //check if the story is saved
if (document.getElementById('save_story').getAttribute('story_gamesaved') == "false") { if (document.getElementById('save_story').getAttribute('story_gamesaved') == "false") {
@@ -1368,6 +1412,24 @@ function send_world_info(uid) {
} }
//--------------------------------------------General UI Functions------------------------------------ //--------------------------------------------General UI Functions------------------------------------
function select_sample(item) {
for (temp of document.getElementsByClassName("sample_order")) {
temp.classList.remove("selected");
}
item.classList.add("selected");
}
function toggle_setting_category(element) {
item = element.nextSibling.nextSibling;
if (item.classList.contains('hidden')) {
item.classList.remove("hidden");
element.firstChild.nextSibling.firstChild.textContent = "expand_more";
} else {
item.classList.add("hidden");
element.firstChild.nextSibling.firstChild.textContent = "navigate_next";
}
}
function preserve_game_space(preserve) { function preserve_game_space(preserve) {
var r = document.querySelector(':root'); var r = document.querySelector(':root');
console.log("Setting cookie to: "+preserve); console.log("Setting cookie to: "+preserve);

View File

@@ -45,7 +45,7 @@
<div id="Select Options" class="sequence_area"></div> <div id="Select Options" class="sequence_area"></div>
<!------------ Input Area---------------------> <!------------ Input Area--------------------->
<div class="inputrow" id="inputrow_container"> <div class="inputrow" id="inputrow_container">
<textarea row=5 id="input_text" placeholder="Enter text here"></textarea> <textarea autocomplete="off" row=5 id="input_text" placeholder="Enter text here"></textarea>
<div class="statusbar_outer hidden"> <div class="statusbar_outer hidden">
<div class="statusbar_inner" style="width:0%">0%</div> <div class="statusbar_inner" style="width:0%">0%</div>
</div><br> </div><br>

View File

@@ -27,15 +27,23 @@
<!-- top menu bar--> <!-- top menu bar-->
<div class="menu_pin_area"></div> <div class="menu_pin_area"></div>
<div class="tabrow"> <div class="tabrow">
<span class="setting_menu_button selected" onclick="show_setting_menu(this);">Story</span> <span class="setting_menu_button selected" onclick="show_setting_menu(this);">Home</span>
<span class="setting_menu_button" onclick="show_setting_menu(this);">Model</span> <span class="setting_menu_button" onclick="show_setting_menu(this);">Settings</span>
<span class="setting_menu_button" onclick="show_setting_menu(this);">User</span> <span class="setting_menu_button" onclick="show_setting_menu(this);">Interface</span>
<span class="setting_menu_button" onclick="show_setting_menu(this);">UI</span>
<span style="float: right;margin-right: 30px;" onclick="window.open('https://github.com/KoboldAI/KoboldAI-Client/wiki');">Help</span> <span style="float: right;margin-right: 30px;" onclick="window.open('https://github.com/KoboldAI/KoboldAI-Client/wiki');">Help</span>
</div> </div>
<div class="flyout_menu_contents"> <div class="flyout_menu_contents">
<div id="setting_menu_story" class="settings_category_area"> <div id="setting_menu_home" class="settings_category_area">
<div id="Model_Info">
<div>
Running Model: <span class="var_sync_model_model">ReadOnly</span>
</div>
<div>
<button class="btn action_button" onclick="socket.emit('load_model_button', {});">Load Model</button>
<select class="var_sync_model_selected_preset settings_select presets" onchange='sync_to_server(this)'><option>Preset</option></select>
</div>
</div>
<div id="Story_Info"> <div id="Story_Info">
<hr/> <hr/>
<div class="story_title_area"> <div class="story_title_area">
@@ -44,7 +52,8 @@
<span class="var_sync_story_story_name fullwidth" contenteditable=true onblur="sync_to_server(this);"></span> <span class="var_sync_story_story_name fullwidth" contenteditable=true onblur="sync_to_server(this);"></span>
</span> </span>
<div class="story_title_icons"> <div class="story_title_icons">
<span class="material-icons-outlined cursor" title="Load Story" onclick="socket.emit('load_story_list', '');">file_open</span> <span class="material-icons-outlined cursor" title="New Story" onclick="socket.emit('new_story', '');">description</span>
<span class="material-icons-outlined cursor" title="Load Story" onclick="socket.emit('load_story_list', '');">folder_open</span>
<span class="material-icons-outlined cursor var_sync_alt_story_gamesaved" title="Save Story">save</span> <span class="material-icons-outlined cursor var_sync_alt_story_gamesaved" title="Save Story">save</span>
<span class="material-icons-outlined cursor" title="Import Story">cloud_download</span> <span class="material-icons-outlined cursor" title="Import Story">cloud_download</span>
<span class="material-icons-outlined cursor" title="Download Story" onclick="document.getElementById('download_iframe').src = 'json';">file_download</span> <span class="material-icons-outlined cursor" title="Download Story" onclick="document.getElementById('download_iframe').src = 'json';">file_download</span>
@@ -53,18 +62,97 @@
<hr/> <hr/>
</div> </div>
<div class="setting_tile_area"> <div class="setting_tile_area">
{% with menu='Story' %} {% with menu='Home' %}
{% include 'settings item.html' %} {% with sub_path='' %}
{% include 'settings item.html' %}
{% endwith %}
{% endwith %} {% endwith %}
</div> </div>
<h4 id="biases_label"> </div>
<span id="bias_open" class="oi" data-glyph="chevron-bottom" onclick='this.classList.add("hidden"); <div id="setting_menu_settings" class="hidden settings_category_area">
document.getElementById("bias_close").classList.remove("hidden"); <div><select class="var_sync_model_selected_preset settings_select presets" onchange='sync_to_server(this)'><option>Preset</option></select></div>
document.getElementById("biasing").classList.add("hidden");'> Biasing:</span> {% with menu='Settings' %}
<span id="bias_close" class="oi hidden" data-glyph="chevron-right" onclick='this.classList.add("hidden"); <div onclick="toggle_setting_category(this);">
document.getElementById("bias_open").classList.remove("hidden"); <h4 style="width:var(--flyout_menu_width);"><span class="material-icons-outlined cursor">expand_more</span> Generation</h4>
document.getElementById("biasing").classList.remove("hidden");'> Biasing:</span> </div>
</h4> <div class="setting_tile_area">
{% with sub_path='Generation' %}
{% include 'settings item.html' %}
{% endwith %}
</div>
<div onclick="toggle_setting_category(this);">
<h4 style="width:var(--flyout_menu_width);"><span class="material-icons-outlined cursor">expand_more</span> Sampling</h4>
</div>
<div class="setting_tile_area">
<div class="setting_container_single">
<!---Top Row---->
<span class="setting_label">
Sample Order:
<span class="helpicon">
?
<span class="helptext">
Sample Order Tooltip
</span>
</span>
</span>
<!---Bottom Row---->
<span class="setting_item">
<div style="display:flex;flex-direction:row;">
<ul id="sample_order_list" style="width:calc(var(--flyout_menu_width) - 60px);">
<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-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);">Typical Sampling</li>
<li class="sample_order cursor" onclick="select_sample(this);">Temperature</li>
</ul>
<div style="display:flex;flex-direction:column;justify-content:center;align-items:center;">
<div class="material-icons-outlined cursor" onclick="move_sample('up');">arrow_upward</div>
<div class="material-icons-outlined cursor" onclick="move_sample('down');">arrow_downward</div>
</div>
</div>
</span>
<!---Slider Labels--->
<span class="setting_minlabel"><span style="top: -4px; position: relative;"></span></span>
<span class="setting_maxlabel"><span style="top: -4px; position: relative;"></span></span>
</div>
{% with sub_path='Sampling' %}
{% include 'settings item.html' %}
{% endwith %}
</div>
<div onclick="toggle_setting_category(this);">
<h4 style="width:var(--flyout_menu_width);"><span class="material-icons-outlined cursor">expand_more</span> Repetition</h4>
</div>
<div class="setting_tile_area">
{% with sub_path='Repetition' %}
{% include 'settings item.html' %}
{% endwith %}
</div>
<div onclick="toggle_setting_category(this);">
<h4 style="width:var(--flyout_menu_width);"><span class="material-icons-outlined cursor">expand_more</span> Other</h4>
</div>
<div class="setting_tile_area">
{% with sub_path='Other' %}
{% include 'settings item.html' %}
{% endwith %}
</div>
<div onclick="toggle_setting_category(this);">
<h4 style="width:var(--flyout_menu_width);"><span class="material-icons-outlined cursor">expand_more</span> Modifiers</h4>
</div>
<div class="setting_tile_area">
{% with sub_path='Modifiers' %}
{% include 'settings item.html' %}
{% endwith %}
</div>
{% endwith %}
<div onclick="toggle_setting_category(this);">
<h4 style="width:var(--flyout_menu_width);"><span class="material-icons-outlined cursor">expand_more</span> Biasing</h4>
</div>
<div id="biasing"> <div id="biasing">
<div class="bias_header"> <div class="bias_header">
<div class="bias_header_phrase">Phrase</div> <div class="bias_header_phrase">Phrase</div>
@@ -73,30 +161,14 @@
</div> </div>
</div> </div>
</div> </div>
<div id="setting_menu_model" class="hidden settings_category_area"> <div id="setting_menu_interface" class="hidden settings_category_area">
<div id="Model_Info">
<div>
Running Model: <span class="var_sync_model_model">ReadOnly</span>
<select id=presets class="var_sync_model_selected_preset settings_select presets" onchange='sync_to_server(this)'><option>Preset</option></select>
</div>
<div><button class="btn action_button" onclick="socket.emit('load_model_button', {});">Load Model</button></div>
</div>
<div class="setting_tile_area"> <div class="setting_tile_area">
{% with menu='Model' %} {% with menu='Interface' %}
{% include 'settings item.html' %} {% with sub_path='UI' %}
{% include 'settings item.html' %}
{% endwith %}
{% endwith %} {% endwith %}
</div> <div class="setting_container">
</div>
<div id="setting_menu_user" class="hidden settings_category_area">
<div class="setting_tile_area">
{% with menu='User' %}
{% include 'settings item.html' %}
{% endwith %}
</div>
</div>
<div id="setting_menu_ui" class="hidden settings_category_area">
<div class="setting_tile_area">
<div class="setting_container">
<span class="setting_label"> <span class="setting_label">
Maximize Game Text Space: Maximize Game Text Space:
<span class="helpicon"> <span class="helpicon">
@@ -132,4 +204,9 @@
</div> </div>
</div> </div>
</div> </div>
<div id="setting_menu_ui" class="hidden settings_category_area">
<div class="setting_tile_area">
</div>
</div>
</div> </div>

View File

@@ -1,5 +1,5 @@
{% for item in settings %} {% for item in settings %}
{% if item["menu_path"] == menu %} {% if item["menu_path"] == menu and item['sub_path'] == sub_path %}
<div class="setting_container"> <div class="setting_container">
<!---Top Row----> <!---Top Row---->
<span class="setting_label"> <span class="setting_label">
@@ -12,7 +12,7 @@
</span> </span>
</span> </span>
{% if (item['unit'] != 'bool') and (item['unit'] != 'text') %} {% if (item['unit'] != 'bool') and (item['unit'] != 'text') %}
<input class="setting_value var_sync_{{ item['classname'] }}_{{ item['name'] }}" id="{{ item['classname'] }}_{{ item['name'] }}_cur" <input autocomplete="off" class="setting_value var_sync_{{ item['classname'] }}_{{ item['name'] }}" id="{{ item['classname'] }}_{{ item['name'] }}_cur"
value="{{ item['default'] }}" item_id="{{ item['classname'] }}_{{ item['name'] }}" value="{{ item['default'] }}" item_id="{{ item['classname'] }}_{{ item['name'] }}"
{% if item['unit'] == 'float' %} inputmode="decimal"{% elif item['unit'] == 'float' %} inputmode="numeric"{% endif %} {% if item['unit'] == 'float' %} inputmode="decimal"{% elif item['unit'] == 'float' %} inputmode="numeric"{% endif %}
onchange="document.getElementById(this.getAttribute('item_id')).value = this.value; socket.emit('var_change', {'ID': this.id.replace('_cur', ''), 'value': this.value});"> onchange="document.getElementById(this.getAttribute('item_id')).value = this.value; socket.emit('var_change', {'ID': this.id.replace('_cur', ''), 'value': this.value});">

View File

@@ -30,15 +30,15 @@
<div id="story_menu_memory" class="story_category_area"> <div id="story_menu_memory" class="story_category_area">
<div id="Memory"> <div id="Memory">
Memory:<br/> Memory:<br/>
<textarea rows=20 id="memory" class="var_sync_story_memory var_sync_alt_story_memory_length fullwidth" onchange='sync_to_server(this);'></textarea> <textarea rows=20 id="memory" class="var_sync_story_memory var_sync_alt_story_memory_length fullwidth" onchange='sync_to_server(this);' autocomplete="off"></textarea>
</div> </div>
</div> </div>
<div id="story_menu_author" class="story_category_area hidden"> <div id="story_menu_author" class="story_category_area hidden">
<div id="author_notes"> <div id="author_notes">
Author's Notes:<br/> Author's Notes:<br/>
<textarea rows=5 id="authors_notes" class="var_sync_story_authornote var_sync_alt_story_authornote_length fullwidth" onchange='sync_to_server(this);'></textarea><br/> <textarea autocomplete="off" rows=5 id="authors_notes" class="var_sync_story_authornote var_sync_alt_story_authornote_length fullwidth" onchange='sync_to_server(this);'></textarea><br/>
Template:<br/> Template:<br/>
<input type=text class="var_sync_story_authornotetemplate fullwidth" onchange='sync_to_server(this);'><br/> <input autocomplete="off" type=text class="var_sync_story_authornotetemplate fullwidth" onchange='sync_to_server(this);'><br/>
andepth<br/> andepth<br/>
<input type="range" min="0" max="5" step="1" <input type="range" min="0" max="5" step="1"
value="3" class="setting_item_input var_sync_story_andepth" value="3" class="setting_item_input var_sync_story_andepth"
@@ -52,7 +52,7 @@
<div id="story_menu_notes" class="story_category_area hidden"> <div id="story_menu_notes" class="story_category_area hidden">
<div id="Notes"> <div id="Notes">
Notes (ignored by AI):<br/> Notes (ignored by AI):<br/>
<textarea rows=20 class="var_sync_story_notes fullwidth" onchange='sync_to_server(this);'></textarea> <textarea autocomplete="off" rows=20 class="var_sync_story_notes fullwidth" onchange='sync_to_server(this);'></textarea>
</div> </div>
</div> </div>
<div id="story_menu_wi" class="story_category_area hidden"> <div id="story_menu_wi" class="story_category_area hidden">