diff --git a/default/content/index.json b/default/content/index.json index 2d9afb5cc..3294b0f17 100644 --- a/default/content/index.json +++ b/default/content/index.json @@ -507,10 +507,6 @@ "filename": "presets/context/Minimalist.json", "type": "context" }, - { - "filename": "presets/context/Mistral.json", - "type": "context" - }, { "filename": "presets/context/NovelAI.json", "type": "context" @@ -591,10 +587,6 @@ "filename": "presets/instruct/Metharme.json", "type": "instruct" }, - { - "filename": "presets/instruct/Mistral.json", - "type": "instruct" - }, { "filename": "presets/instruct/OpenOrca-OpenChat.json", "type": "instruct" @@ -726,5 +718,29 @@ { "filename": "presets/sysprompt/Neutral - Chat.json", "type": "sysprompt" + }, + { + "filename": "presets/instruct/Mistral V1.json", + "type": "instruct" + }, + { + "filename": "presets/context/Mistral V1.json", + "type": "context" + }, + { + "filename": "presets/instruct/Mistral V2 & V3.json", + "type": "instruct" + }, + { + "filename": "presets/context/Mistral V2 & V3.json", + "type": "context" + }, + { + "filename": "presets/instruct/Mistral V3-Tekken.json", + "type": "instruct" + }, + { + "filename": "presets/context/Mistral V3-Tekken.json", + "type": "context" } ] diff --git a/default/content/presets/context/Mistral V1.json b/default/content/presets/context/Mistral V1.json new file mode 100644 index 000000000..75bb82cb1 --- /dev/null +++ b/default/content/presets/context/Mistral V1.json @@ -0,0 +1,12 @@ +{ + "story_string": " [INST] {{#if system}}{{system}}\n{{/if}}{{#if wiBefore}}{{wiBefore}}\n{{/if}}{{#if description}}{{description}}\n{{/if}}{{#if personality}}{{personality}}\n{{/if}}{{#if scenario}}{{scenario}}\n{{/if}}{{#if wiAfter}}{{wiAfter}}\n{{/if}}{{#if persona}}{{persona}}\n{{/if}}{{trim}} [/INST] Understood.", + "example_separator": "", + "chat_start": "", + "use_stop_strings": false, + "allow_jailbreak": false, + "always_force_name2": true, + "trim_sentences": false, + "include_newline": false, + "single_line": false, + "name": "Mistral V1" +} diff --git a/default/content/presets/context/Mistral.json b/default/content/presets/context/Mistral V2 & V3.json similarity index 54% rename from default/content/presets/context/Mistral.json rename to default/content/presets/context/Mistral V2 & V3.json index d9551afe8..3102e1112 100644 --- a/default/content/presets/context/Mistral.json +++ b/default/content/presets/context/Mistral V2 & V3.json @@ -1,6 +1,6 @@ { - "story_string": "[INST] {{#if system}}{{system}}\n{{/if}}{{#if wiBefore}}{{wiBefore}}\n{{/if}}{{#if description}}{{description}}\n{{/if}}{{#if personality}}{{char}}'s personality: {{personality}}\n{{/if}}{{#if scenario}}Scenario: {{scenario}}\n{{/if}}{{#if wiAfter}}{{wiAfter}}\n{{/if}}{{#if persona}}{{persona}}\n{{/if}}{{trim}} [/INST]", - "example_separator": "Examples:", + "story_string": "[INST] {{#if system}}{{system}}\n{{/if}}{{#if wiBefore}}{{wiBefore}}\n{{/if}}{{#if description}}{{description}}\n{{/if}}{{#if personality}}{{personality}}\n{{/if}}{{#if scenario}}{{scenario}}\n{{/if}}{{#if wiAfter}}{{wiAfter}}\n{{/if}}{{#if persona}}{{persona}}\n{{/if}}{{trim}}[/INST] Understood.", + "example_separator": "", "chat_start": "", "use_stop_strings": false, "allow_jailbreak": false, @@ -8,5 +8,5 @@ "trim_sentences": false, "include_newline": false, "single_line": false, - "name": "Mistral" + "name": "Mistral V2 & V3" } diff --git a/default/content/presets/context/Mistral V3-Tekken.json b/default/content/presets/context/Mistral V3-Tekken.json new file mode 100644 index 000000000..26e196b5b --- /dev/null +++ b/default/content/presets/context/Mistral V3-Tekken.json @@ -0,0 +1,12 @@ +{ + "story_string": "[INST]{{#if system}}{{system}}\n{{/if}}{{#if wiBefore}}{{wiBefore}}\n{{/if}}{{#if description}}{{description}}\n{{/if}}{{#if personality}}{{personality}}\n{{/if}}{{#if scenario}}{{scenario}}\n{{/if}}{{#if wiAfter}}{{wiAfter}}\n{{/if}}{{#if persona}}{{persona}}\n{{/if}}{{trim}}[/INST]Understood.", + "example_separator": "", + "chat_start": "", + "use_stop_strings": false, + "allow_jailbreak": false, + "always_force_name2": true, + "trim_sentences": false, + "include_newline": false, + "single_line": false, + "name": "Mistral V3-Tekken" +} diff --git a/default/content/presets/instruct/Mistral V1.json b/default/content/presets/instruct/Mistral V1.json new file mode 100644 index 000000000..c47dbdc77 --- /dev/null +++ b/default/content/presets/instruct/Mistral V1.json @@ -0,0 +1,22 @@ +{ + "input_sequence": " [INST] ", + "output_sequence": " [/INST] ", + "last_output_sequence": " [/INST]", + "system_sequence": "", + "stop_sequence": "", + "wrap": false, + "macro": true, + "names_behavior": "always", + "activation_regex": "", + "system_sequence_prefix": "", + "system_sequence_suffix": "", + "first_output_sequence": "", + "skip_examples": false, + "output_suffix": "", + "input_suffix": "", + "system_suffix": "", + "user_alignment_message": "Let's get started. Please respond based on the information and instructions provided above.", + "system_same_as_user": true, + "last_system_sequence": "", + "name": "Mistral V1" +} diff --git a/default/content/presets/instruct/Mistral V2 & V3.json b/default/content/presets/instruct/Mistral V2 & V3.json new file mode 100644 index 000000000..7619a1aa5 --- /dev/null +++ b/default/content/presets/instruct/Mistral V2 & V3.json @@ -0,0 +1,22 @@ +{ + "input_sequence": "[INST] ", + "output_sequence": "[/INST] ", + "last_output_sequence": "[/INST]", + "system_sequence": "", + "stop_sequence": "", + "wrap": false, + "macro": true, + "names_behavior": "always", + "activation_regex": "", + "system_sequence_prefix": "", + "system_sequence_suffix": "", + "first_output_sequence": "", + "skip_examples": false, + "output_suffix": "", + "input_suffix": "", + "system_suffix": "", + "user_alignment_message": "Let's get started. Please respond based on the information and instructions provided above.", + "system_same_as_user": true, + "last_system_sequence": "", + "name": "Mistral V2 & V3" +} diff --git a/default/content/presets/instruct/Mistral.json b/default/content/presets/instruct/Mistral V3-Tekken.json similarity index 77% rename from default/content/presets/instruct/Mistral.json rename to default/content/presets/instruct/Mistral V3-Tekken.json index 6921ef0c2..217007d73 100644 --- a/default/content/presets/instruct/Mistral.json +++ b/default/content/presets/instruct/Mistral V3-Tekken.json @@ -1,6 +1,6 @@ { - "input_sequence": "[INST] ", - "output_sequence": "", + "input_sequence": "[INST]", + "output_sequence": "[/INST]", "last_output_sequence": "", "system_sequence": "", "stop_sequence": "", @@ -12,11 +12,11 @@ "system_sequence_suffix": "", "first_output_sequence": "", "skip_examples": false, - "output_suffix": "\n", - "input_suffix": " [/INST]\n", + "output_suffix": "", + "input_suffix": "", "system_suffix": "", "user_alignment_message": "Let's get started. Please respond based on the information and instructions provided above.", "system_same_as_user": true, "last_system_sequence": "", - "name": "Mistral" + "name": "Mistral V3-Tekken" } diff --git a/default/content/presets/novel/Asper-Kayra.json b/default/content/presets/novel/Asper-Kayra.json index c611949cc..0fa8f9979 100644 --- a/default/content/presets/novel/Asper-Kayra.json +++ b/default/content/presets/novel/Asper-Kayra.json @@ -16,5 +16,9 @@ "prefix": "vanilla", "cfg_scale": 1, "phrase_rep_pen": "medium", - "max_context": 7800 + "max_context": 7800, + "min_p": 0, + "math1_temp": 1, + "math1_quad": 0, + "math1_quad_entropy_scale": 0 } diff --git a/default/content/presets/novel/Blended-Coffee-Kayra.json b/default/content/presets/novel/Blended-Coffee-Kayra.json index 62dad3a4d..de830aee7 100644 --- a/default/content/presets/novel/Blended-Coffee-Kayra.json +++ b/default/content/presets/novel/Blended-Coffee-Kayra.json @@ -15,5 +15,9 @@ "prefix": "vanilla", "phrase_rep_pen": "medium", "cfg_scale": 1.55, - "max_context": 7800 + "max_context": 7800, + "min_p": 0, + "math1_temp": 1, + "math1_quad": 0, + "math1_quad_entropy_scale": 0 } diff --git a/default/content/presets/novel/Blook-Kayra.json b/default/content/presets/novel/Blook-Kayra.json index 87d845a1a..fd35d9920 100644 --- a/default/content/presets/novel/Blook-Kayra.json +++ b/default/content/presets/novel/Blook-Kayra.json @@ -16,5 +16,9 @@ "prefix": "vanilla", "phrase_rep_pen": "very_aggressive", "cfg_scale": 1.3, - "max_context": 7800 + "max_context": 7800, + "min_p": 0, + "math1_temp": 1, + "math1_quad": 0, + "math1_quad_entropy_scale": 0 } diff --git a/default/content/presets/novel/Carefree-Kayra.json b/default/content/presets/novel/Carefree-Kayra.json index 28e75a371..bba4378fc 100644 --- a/default/content/presets/novel/Carefree-Kayra.json +++ b/default/content/presets/novel/Carefree-Kayra.json @@ -17,5 +17,9 @@ "prefix": "vanilla", "cfg_scale": 1, "phrase_rep_pen": "aggressive", - "max_context": 7800 + "max_context": 7800, + "min_p": 0, + "math1_temp": 1, + "math1_quad": 0, + "math1_quad_entropy_scale": 0 } diff --git a/default/content/presets/novel/CosmicCube-Kayra.json b/default/content/presets/novel/CosmicCube-Kayra.json index ae95c4f97..ed9318449 100644 --- a/default/content/presets/novel/CosmicCube-Kayra.json +++ b/default/content/presets/novel/CosmicCube-Kayra.json @@ -16,5 +16,9 @@ "prefix": "vanilla", "phrase_rep_pen": "off", "cfg_scale": 1.48, - "max_context": 7800 + "max_context": 7800, + "min_p": 0, + "math1_temp": 1, + "math1_quad": 0, + "math1_quad_entropy_scale": 0 } diff --git a/default/content/presets/novel/Edgewise-Clio.json b/default/content/presets/novel/Edgewise-Clio.json index 77ecaef71..ff5f517f5 100644 --- a/default/content/presets/novel/Edgewise-Clio.json +++ b/default/content/presets/novel/Edgewise-Clio.json @@ -17,5 +17,9 @@ "prefix": "vanilla", "cfg_scale": 1, "phrase_rep_pen": "very_light", - "max_context": 7800 + "max_context": 7800, + "min_p": 0, + "math1_temp": 1, + "math1_quad": 0, + "math1_quad_entropy_scale": 0 } diff --git a/default/content/presets/novel/Fresh-Coffee-Clio.json b/default/content/presets/novel/Fresh-Coffee-Clio.json index ad520adfb..15df88905 100644 --- a/default/content/presets/novel/Fresh-Coffee-Clio.json +++ b/default/content/presets/novel/Fresh-Coffee-Clio.json @@ -18,5 +18,9 @@ "prefix": "vanilla", "cfg_scale": 1, "phrase_rep_pen": "very_light", - "max_context": 7800 + "max_context": 7800, + "min_p": 0, + "math1_temp": 1, + "math1_quad": 0, + "math1_quad_entropy_scale": 0 } diff --git a/default/content/presets/novel/Fresh-Coffee-Kayra.json b/default/content/presets/novel/Fresh-Coffee-Kayra.json index 383fcba1c..4abbc5bec 100644 --- a/default/content/presets/novel/Fresh-Coffee-Kayra.json +++ b/default/content/presets/novel/Fresh-Coffee-Kayra.json @@ -16,5 +16,9 @@ "prefix": "vanilla", "cfg_scale": 1, "phrase_rep_pen": "off", - "max_context": 7800 + "max_context": 7800, + "min_p": 0, + "math1_temp": 1, + "math1_quad": 0, + "math1_quad_entropy_scale": 0 } diff --git a/default/content/presets/novel/Green-Active-Writer-Kayra.json b/default/content/presets/novel/Green-Active-Writer-Kayra.json index 73b18a087..7fe1e6eb1 100644 --- a/default/content/presets/novel/Green-Active-Writer-Kayra.json +++ b/default/content/presets/novel/Green-Active-Writer-Kayra.json @@ -16,5 +16,9 @@ "prefix": "vanilla", "phrase_rep_pen": "very_aggressive", "cfg_scale": 1.4, - "max_context": 7800 + "max_context": 7800, + "min_p": 0, + "math1_temp": 1, + "math1_quad": 0, + "math1_quad_entropy_scale": 0 } diff --git a/default/content/presets/novel/Keelback-Clio.json b/default/content/presets/novel/Keelback-Clio.json index 9412a116b..821bbdd42 100644 --- a/default/content/presets/novel/Keelback-Clio.json +++ b/default/content/presets/novel/Keelback-Clio.json @@ -18,5 +18,9 @@ "prefix": "vanilla", "cfg_scale": 1, "phrase_rep_pen": "very_light", - "max_context": 7800 + "max_context": 7800, + "min_p": 0, + "math1_temp": 1, + "math1_quad": 0, + "math1_quad_entropy_scale": 0 } diff --git a/default/content/presets/novel/Long-Press-Clio.json b/default/content/presets/novel/Long-Press-Clio.json index c978924b3..3bd67c84a 100644 --- a/default/content/presets/novel/Long-Press-Clio.json +++ b/default/content/presets/novel/Long-Press-Clio.json @@ -18,5 +18,9 @@ "prefix": "vanilla", "cfg_scale": 1, "phrase_rep_pen": "very_light", - "max_context": 7800 + "max_context": 7800, + "min_p": 0, + "math1_temp": 1, + "math1_quad": 0, + "math1_quad_entropy_scale": 0 } diff --git a/default/content/presets/novel/Pilotfish-Kayra.json b/default/content/presets/novel/Pilotfish-Kayra.json index 4a8d06ac2..87cd24ba4 100644 --- a/default/content/presets/novel/Pilotfish-Kayra.json +++ b/default/content/presets/novel/Pilotfish-Kayra.json @@ -18,5 +18,9 @@ "prefix": "vanilla", "phrase_rep_pen": "medium", "cfg_scale": 1.35, - "max_context": 7800 + "max_context": 7800, + "min_p": 0, + "math1_temp": 1, + "math1_quad": 0, + "math1_quad_entropy_scale": 0 } diff --git a/default/content/presets/novel/Pro_Writer-Kayra.json b/default/content/presets/novel/Pro_Writer-Kayra.json index a020d462b..11a18f031 100644 --- a/default/content/presets/novel/Pro_Writer-Kayra.json +++ b/default/content/presets/novel/Pro_Writer-Kayra.json @@ -16,5 +16,9 @@ "prefix": "vanilla", "phrase_rep_pen": "medium", "cfg_scale": 1.0, - "max_context": 7800 + "max_context": 7800, + "min_p": 0, + "math1_temp": 1, + "math1_quad": 0, + "math1_quad_entropy_scale": 0 } diff --git a/default/content/presets/novel/Stelenes-Kayra.json b/default/content/presets/novel/Stelenes-Kayra.json index dae13cecd..68cb0b8de 100644 --- a/default/content/presets/novel/Stelenes-Kayra.json +++ b/default/content/presets/novel/Stelenes-Kayra.json @@ -13,5 +13,9 @@ "return_full_text": false, "prefix": "vanilla", "phrase_rep_pen": "medium", - "max_context": 7800 + "max_context": 7800, + "min_p": 0, + "math1_temp": 1, + "math1_quad": 0, + "math1_quad_entropy_scale": 0 } diff --git a/default/content/presets/novel/Talker-Chat-Clio.json b/default/content/presets/novel/Talker-Chat-Clio.json index 136845554..390cbf178 100644 --- a/default/content/presets/novel/Talker-Chat-Clio.json +++ b/default/content/presets/novel/Talker-Chat-Clio.json @@ -18,5 +18,9 @@ "prefix": "vanilla", "cfg_scale": 1, "phrase_rep_pen": "very_light", - "max_context": 7800 + "max_context": 7800, + "min_p": 0, + "math1_temp": 1, + "math1_quad": 0, + "math1_quad_entropy_scale": 0 } diff --git a/default/content/presets/novel/Tea_Time-Kayra.json b/default/content/presets/novel/Tea_Time-Kayra.json index af57676ce..2142a0c2b 100644 --- a/default/content/presets/novel/Tea_Time-Kayra.json +++ b/default/content/presets/novel/Tea_Time-Kayra.json @@ -15,5 +15,9 @@ "prefix": "vanilla", "phrase_rep_pen": "aggressive", "cfg_scale": 1.0, - "max_context": 7800 + "max_context": 7800, + "min_p": 0, + "math1_temp": 1, + "math1_quad": 0, + "math1_quad_entropy_scale": 0 } diff --git a/default/content/presets/novel/Tesseract-Kayra.json b/default/content/presets/novel/Tesseract-Kayra.json index 919461937..0948dbe60 100644 --- a/default/content/presets/novel/Tesseract-Kayra.json +++ b/default/content/presets/novel/Tesseract-Kayra.json @@ -14,5 +14,9 @@ "prefix": "vanilla", "phrase_rep_pen": "aggressive", "cfg_scale": 1.3, - "max_context": 7800 + "max_context": 7800, + "min_p": 0, + "math1_temp": 1, + "math1_quad": 0, + "math1_quad_entropy_scale": 0 } diff --git a/default/content/presets/novel/Vingt-Un-Clio.json b/default/content/presets/novel/Vingt-Un-Clio.json index 296b8c564..bf0eb8f23 100644 --- a/default/content/presets/novel/Vingt-Un-Clio.json +++ b/default/content/presets/novel/Vingt-Un-Clio.json @@ -18,5 +18,9 @@ "prefix": "vanilla", "cfg_scale": 1, "phrase_rep_pen": "very_light", - "max_context": 7800 + "max_context": 7800, + "min_p": 0, + "math1_temp": 1, + "math1_quad": 0, + "math1_quad_entropy_scale": 0 } diff --git a/default/content/presets/novel/Writers-Daemon-Kayra.json b/default/content/presets/novel/Writers-Daemon-Kayra.json index 8ae98884c..70561d483 100644 --- a/default/content/presets/novel/Writers-Daemon-Kayra.json +++ b/default/content/presets/novel/Writers-Daemon-Kayra.json @@ -17,5 +17,9 @@ "return_full_text": false, "prefix": "vanilla", "phrase_rep_pen": "very_aggressive", - "max_context": 7800 + "max_context": 7800, + "min_p": 0, + "math1_temp": 1, + "math1_quad": 0, + "math1_quad_entropy_scale": 0 } diff --git a/public/index.html b/public/index.html index bfc8f9167..4345a0a25 100644 --- a/public/index.html +++ b/public/index.html @@ -323,6 +323,19 @@ +
+
+ Min P +
+
+
+ +
+
+ +
+
+
TFS @@ -336,6 +349,136 @@
+
+
+ Top P +
+
+
+ +
+
+ +
+
+
+
+
+ Top A +
+
+
+ +
+
+ +
+
+
+
+
+ Top K +
+
+
+ +
+
+ +
+
+
+
+
+ Mirostat Tau +
+
+
+ +
+
+ +
+
+
+
+
+ Mirostat LR +
+
+
+ +
+
+ +
+
+
+
+
+ Typical P +
+
+
+ +
+
+ +
+
+
+
+
+ Linear +
+
+
+ +
+
+ +
+
+
+
+
+ Quad +
+
+
+ +
+
+ +
+
+
+
+
+ Conf +
+
+
+ +
+
+ +
+
+
+
+
+ Min Length +
+
+
+ +
+
+ +
+
+
Phrase Repetition Penalty @@ -349,6 +492,72 @@
+
+
+ Preamble +
+
+
+
+
+ Use style tags to modify the writing style of the output. +
+
+ +
+
+
+
+ Banned Tokens +
+
+ Sequences you don't want to appear in the output. One per line. Text or [token ids]. +
+
+ +
+
+
+
+ Logit Bias +
+ + Add +
+
+
+ Helps to ban or reinforce the usage of certain tokens. +
+
+
+
+
+
+
+
+ CFG Scale +
+
+
+ +
+
+ +
+
+
+
+
+ Negative Prompt +
+
+ +
+ + Used if CFG Scale is unset globally, per chat or character + +
+
@@ -907,163 +1116,6 @@
-
-
- Preamble -
-
-
-
-
- Use style tags to modify the writing style of the output. -
-
- -
-
-
-
- Banned Tokens -
-
- Sequences you don't want to appear in the output. One per line. Text or [token ids]. -
-
- -
-
-
-
- Logit Bias -
- - Add -
-
-
- Helps to ban or reinforce the usage of certain tokens. -
-
-
-
-
-
-
-
- CFG Scale -
-
-
- -
-
- -
-
-
-
-
- Negative Prompt -
-
- -
- - Used if CFG Scale is unset globally, per chat or character - -
-
-
-
- Top P -
-
-
- -
-
- -
-
-
-
-
- Top A -
-
-
- -
-
- -
-
-
-
-
- Top K -
-
-
- -
-
- -
-
-
-
-
- Mirostat Tau -
-
-
- -
-
- -
-
-
-
-
- Mirostat LR -
-
-
- -
-
- -
-
-
-
-
- Typical P -
-
-
- -
-
- -
-
-
-
-
- Min Length -
-
-
- -
-
- -
-
-
Samplers Order @@ -1113,6 +1165,16 @@ 8
+
+ Unified Sampling + 9 +
+
+
+ Min P + 10 +
+
diff --git a/public/scripts/instruct-mode.js b/public/scripts/instruct-mode.js index 3935060a0..6c6124fa9 100644 --- a/public/scripts/instruct-mode.js +++ b/public/scripts/instruct-mode.js @@ -531,6 +531,19 @@ export function formatInstructModePrompt(name, isImpersonate, promptBias, name1, } let sequence = getSequence() || ''; + let nameFiller = ''; + + // A hack for Mistral's formatting that has a normal output sequence ending with a space + if ( + includeNames && + power_user.instruct.last_output_sequence && + power_user.instruct.output_sequence && + sequence === power_user.instruct.last_output_sequence && + /\s$/.test(power_user.instruct.output_sequence) && + !/\s$/.test(power_user.instruct.last_output_sequence) + ) { + nameFiller = power_user.instruct.output_sequence.slice(-1); + } if (power_user.instruct.macro) { sequence = substituteParams(sequence, name1, name2); @@ -538,7 +551,7 @@ export function formatInstructModePrompt(name, isImpersonate, promptBias, name1, } const separator = power_user.instruct.wrap ? '\n' : ''; - let text = includeNames ? (separator + sequence + separator + `${name}:`) : (separator + sequence); + let text = includeNames ? (separator + sequence + separator + nameFiller + `${name}:`) : (separator + sequence); // Quiet prompt already has a newline at the end if (isQuiet && separator) { diff --git a/public/scripts/nai-settings.js b/public/scripts/nai-settings.js index 6b59033a8..2aee79537 100644 --- a/public/scripts/nai-settings.js +++ b/public/scripts/nai-settings.js @@ -38,6 +38,10 @@ export const nai_settings = { top_p: 0.75, top_a: 0.08, typical_p: 0.975, + min_p: 0, + math1_temp: 1, + math1_quad: 0, + math1_quad_entropy_scale: 0, min_length: 1, model_novel: 'clio-v1', preset_settings_novel: 'Talker-Chat-Clio', @@ -151,6 +155,10 @@ export function loadNovelPreset(preset) { nai_settings.order = preset.order || default_order; nai_settings.logit_bias = preset.logit_bias || []; nai_settings.preamble = preset.preamble || default_preamble; + nai_settings.min_p = preset.min_p || 0; + nai_settings.math1_temp = preset.math1_temp || 1; + nai_settings.math1_quad = preset.math1_quad || 0; + nai_settings.math1_quad_entropy_scale = preset.math1_quad_entropy_scale || 0; loadNovelSettingsUi(nai_settings); } @@ -188,6 +196,10 @@ export function loadNovelSettings(settings) { nai_settings.banned_tokens = settings.banned_tokens || ''; nai_settings.order = settings.order || default_order; nai_settings.logit_bias = settings.logit_bias || []; + nai_settings.min_p = settings.min_p || 0; + nai_settings.math1_temp = settings.math1_temp || 1; + nai_settings.math1_quad = settings.math1_quad || 0; + nai_settings.math1_quad_entropy_scale = settings.math1_quad_entropy_scale || 0; loadNovelSettingsUi(nai_settings); } @@ -227,6 +239,14 @@ function loadNovelSettingsUi(ui_settings) { $('#nai_prefix').val(ui_settings.prefix || 'vanilla'); $('#nai_cfg_uc').val(ui_settings.cfg_uc || ''); $('#nai_banned_tokens').val(ui_settings.banned_tokens || ''); + $('#min_p_novel').val(ui_settings.min_p); + $('#min_p_counter_novel').val(Number(ui_settings.min_p).toFixed(3)); + $('#math1_temp_novel').val(ui_settings.math1_temp); + $('#math1_temp_counter_novel').val(Number(ui_settings.math1_temp).toFixed(2)); + $('#math1_quad_novel').val(ui_settings.math1_quad); + $('#math1_quad_counter_novel').val(Number(ui_settings.math1_quad).toFixed(2)); + $('#math1_quad_entropy_scale_novel').val(ui_settings.math1_quad_entropy_scale); + $('#math1_quad_entropy_scale_counter_novel').val(Number(ui_settings.math1_quad_entropy_scale).toFixed(2)); $('#streaming_novel').prop('checked', ui_settings.streaming_novel); sortItemsByOrder(ui_settings.order); @@ -336,6 +356,30 @@ const sliders = [ format: (val) => val, setValue: (val) => { nai_settings.banned_tokens = val; }, }, + { + sliderId: '#min_p_novel', + counterId: '#min_p_counter_novel', + format: (val) => Number(val).toFixed(3), + setValue: (val) => { nai_settings.min_p = Number(val); }, + }, + { + sliderId: '#math1_temp_novel', + counterId: '#math1_temp_counter_novel', + format: (val) => Number(val).toFixed(2), + setValue: (val) => { nai_settings.math1_temp = Number(val); }, + }, + { + sliderId: '#math1_quad_novel', + counterId: '#math1_quad_counter_novel', + format: (val) => Number(val).toFixed(2), + setValue: (val) => { nai_settings.math1_quad = Number(val); }, + }, + { + sliderId: '#math1_quad_entropy_scale_novel', + counterId: '#math1_quad_entropy_scale_counter_novel', + format: (val) => Number(val).toFixed(2), + setValue: (val) => { nai_settings.math1_quad_entropy_scale = Number(val); }, + }, ]; function getBadWordIds(banned_tokens, tokenizerType) { @@ -469,6 +513,10 @@ export function getNovelGenerationData(finalPrompt, settings, maxLength, isImper 'top_a': Number(nai_settings.top_a), 'top_p': Number(nai_settings.top_p), 'top_k': Number(nai_settings.top_k), + 'min_p': Number(nai_settings.min_p), + 'math1_temp': Number(nai_settings.math1_temp), + 'math1_quad': Number(nai_settings.math1_quad), + 'math1_quad_entropy_scale': Number(nai_settings.math1_quad_entropy_scale), 'typical_p': Number(nai_settings.typical_p), 'mirostat_lr': Number(nai_settings.mirostat_lr), 'mirostat_tau': Number(nai_settings.mirostat_tau), diff --git a/src/endpoints/novelai.js b/src/endpoints/novelai.js index d21602cc2..9cdbdf8cf 100644 --- a/src/endpoints/novelai.js +++ b/src/endpoints/novelai.js @@ -175,6 +175,10 @@ router.post('/generate', jsonParser, async function (req, res) { 'prefix': req.body.prefix, 'order': req.body.order, 'num_logprobs': req.body.num_logprobs, + 'min_p': req.body.min_p, + 'math1_temp': req.body.math1_temp, + 'math1_quad': req.body.math1_quad, + 'math1_quad_entropy_scale': req.body.math1_quad_entropy_scale, }, };