From a0573413b297717b811bcccee60ad411f949a1fc Mon Sep 17 00:00:00 2001 From: Mike Weldon Date: Fri, 11 Aug 2023 17:58:40 -0700 Subject: [PATCH 1/5] Add new NAI samplers and update presets --- public/NovelAI Settings/Asper-Kayra.settings | 17 +++---- .../NovelAI Settings/Carefree-Kayra.settings | 2 +- .../Green-Active-Writer-Kayra.settings | 17 +++---- .../Pro_Writer-Kayra.settings | 13 +++--- .../Writers-Daemon-Kayra.settings | 6 ++- public/index.html | 45 +++++++++++++++++++ public/scripts/nai-settings.js | 33 ++++++++++++++ server.js | 3 ++ 8 files changed, 111 insertions(+), 25 deletions(-) diff --git a/public/NovelAI Settings/Asper-Kayra.settings b/public/NovelAI Settings/Asper-Kayra.settings index 06848fbe4..b4286d358 100644 --- a/public/NovelAI Settings/Asper-Kayra.settings +++ b/public/NovelAI Settings/Asper-Kayra.settings @@ -1,19 +1,20 @@ { - "order": [5, 0, 1, 3], - "temperature": 1.23, + "order": [5, 0, 1, 3, 7], + "temperature": 1.35, "max_length": 300, "min_length": 1, - "top_k": 200, - "typical_p": 0.966, - "tail_free_sampling": 0.982, - "repetition_penalty": 1.74, - "repetition_penalty_range": 4000, + "top_k": 225, + "top_g": 8, + "typical_p": 0.975, + "tail_free_sampling": 0.984, + "repetition_penalty": 1.7, + "repetition_penalty_range": 3200, "repetition_penalty_frequency": 0, "repetition_penalty_presence": 0.02, "use_cache": false, "return_full_text": false, "prefix": "vanilla", "cfg_scale": 1, - "phrase_rep_pen": "aggressive", + "phrase_rep_pen": "medium", "max_context": 7800 } diff --git a/public/NovelAI Settings/Carefree-Kayra.settings b/public/NovelAI Settings/Carefree-Kayra.settings index ffb8e9584..14695f357 100644 --- a/public/NovelAI Settings/Carefree-Kayra.settings +++ b/public/NovelAI Settings/Carefree-Kayra.settings @@ -3,7 +3,7 @@ "temperature": 1.35, "max_length": 300, "min_length": 1, - "top_k": 12, + "top_k": 15, "top_p": 0.85, "top_a": 0.1, "tail_free_sampling": 0.915, diff --git a/public/NovelAI Settings/Green-Active-Writer-Kayra.settings b/public/NovelAI Settings/Green-Active-Writer-Kayra.settings index b849beca4..4db45d37a 100644 --- a/public/NovelAI Settings/Green-Active-Writer-Kayra.settings +++ b/public/NovelAI Settings/Green-Active-Writer-Kayra.settings @@ -1,19 +1,20 @@ { - "order": [6, 1, 0, 5, 3], - "temperature": 1.25, + "order": [6, 0, 8, 5, 3], + "temperature": 1.5, "max_length": 300, "min_length": 1, - "top_k": 70, - "typical_p": 0.9, - "tail_free_sampling": 0.925, - "repetition_penalty": 2, + "typical_p": 0.95, + "tail_free_sampling": 0.95, + "mirostat_lr": 0.2, + "mirostat_tau": 5.5, + "repetition_penalty": 1, "repetition_penalty_range": 1632, "repetition_penalty_frequency": 0, "repetition_penalty_presence": 0, "use_cache": false, "return_full_text": false, "prefix": "vanilla", - "phrase_rep_pen": "aggressive", - "cfg_scale": 1.825, + "phrase_rep_pen": "very_aggressive", + "cfg_scale": 1.4, "max_context": 7800 } diff --git a/public/NovelAI Settings/Pro_Writer-Kayra.settings b/public/NovelAI Settings/Pro_Writer-Kayra.settings index 99486aff5..96a617ba9 100644 --- a/public/NovelAI Settings/Pro_Writer-Kayra.settings +++ b/public/NovelAI Settings/Pro_Writer-Kayra.settings @@ -1,12 +1,13 @@ { - "order": [3, 4, 0], - "temperature": 1.19, + "order": [3, 4, 5, 0], + "temperature": 1.06, "max_length": 300, "min_length": 1, - "top_a": 0.116, - "tail_free_sampling": 0.958, - "repetition_penalty": 1.64, - "repetition_penalty_slope": 2.12, + "top_a": 0.146, + "typical_p": 0.976, + "tail_free_sampling": 0.969, + "repetition_penalty": 1.86, + "repetition_penalty_slope": 2.33, "repetition_penalty_frequency": 0, "repetition_penalty_presence": 0, "repetition_penalty_range": 2048, diff --git a/public/NovelAI Settings/Writers-Daemon-Kayra.settings b/public/NovelAI Settings/Writers-Daemon-Kayra.settings index 04dda3524..bb154935a 100644 --- a/public/NovelAI Settings/Writers-Daemon-Kayra.settings +++ b/public/NovelAI Settings/Writers-Daemon-Kayra.settings @@ -1,12 +1,14 @@ { - "order": [6, 1, 0, 5, 3, 2], + "order": [8, 0, 5, 3, 2, 4], "temperature": 1.5, "max_length": 300, "min_length": 1, - "top_k": 70, + "top_a": 0.02, "top_p": 0.95, "typical_p": 0.95, "tail_free_sampling": 0.95, + "mirostat_lr": 0.2, + "mirostat_tau": 5, "repetition_penalty": 1.6, "repetition_penalty_range": 2016, "repetition_penalty_frequency": 0, diff --git a/public/index.html b/public/index.html index c33e008d2..ff08ed651 100644 --- a/public/index.html +++ b/public/index.html @@ -896,6 +896,51 @@ +
+
+ Top G +
+
+
+ +
+
+
+ select +
+
+
+
+
+
+ Mirostat Tau +
+
+
+ +
+
+
+ select +
+
+
+
+
+
+ Mirostat LR +
+
+
+ +
+
+
+ select +
+
+
+
Typical P diff --git a/public/scripts/nai-settings.js b/public/scripts/nai-settings.js index 7d199325b..93f9139c6 100644 --- a/public/scripts/nai-settings.js +++ b/public/scripts/nai-settings.js @@ -80,6 +80,9 @@ function loadNovelPreset(preset) { nai_settings.min_length = preset.min_length; nai_settings.cfg_scale = preset.cfg_scale; nai_settings.phrase_rep_pen = preset.phrase_rep_pen; + nai_settings.top_g = preset.top_g; + nai_settings.mirostat_lr = preset.mirostat_lr; + nai_settings.mirostat_tau = preset.mirostat_tau; loadNovelSettingsUi(nai_settings); } @@ -105,6 +108,9 @@ function loadNovelSettings(settings) { nai_settings.min_length = settings.min_length; nai_settings.phrase_rep_pen = settings.phrase_rep_pen; nai_settings.cfg_scale = settings.cfg_scale; + nai_settings.top_g = settings.top_g; + nai_settings.mirostat_lr = settings.mirostat_lr; + nai_settings.mirostat_tau = settings.mirostat_tau; nai_settings.streaming_novel = !!settings.streaming_novel; loadNovelSettingsUi(nai_settings); } @@ -169,6 +175,12 @@ function loadNovelSettingsUi(ui_settings) { $("#cfg_scale_counter_novel").text(Number(ui_settings.cfg_scale).toFixed(2)); $("#phrase_rep_pen_novel").val(getPhraseRepPenCounter(ui_settings.phrase_rep_pen)); $("#phrase_rep_pen_counter_novel").text(getPhraseRepPenCounter(ui_settings.phrase_rep_pen)); + $("#top_g_novel").val(ui_settings.top_g); + $("#top_g_counter_novel").text(Number(ui_settings.top_g).toFixed(0)); + $("#mirostat_lr_novel").val(ui_settings.mirostat_lr); + $("#mirostat_lr_counter_novel").text(Number(ui_settings.mirostat_lr).toFixed(2)); + $("#mirostat_tau_novel").val(ui_settings.mirostat_tau); + $("#mirostat_tau_counter_novel").text(Number(ui_settings.mirostat_tau).toFixed(2)); $("#min_length_novel").val(ui_settings.min_length); $("#min_length_counter_novel").text(Number(ui_settings.min_length).toFixed(0)); $('#nai_preamble_textarea').val(ui_settings.nai_preamble); @@ -243,6 +255,24 @@ const sliders = [ format: (val) => Number(val).toFixed(2), setValue: (val) => { nai_settings.typical_p = Number(val).toFixed(2); }, }, + { + sliderId: "#top_g_novel", + counterId: "#top_g_counter_novel", + format: (val) => Number(val).toFixed(0), + setValue: (val) => { nai_settings.top_g = Number(val).toFixed(0); }, + }, + { + sliderId: "#mirostat_tau_novel", + counterId: "#mirostat_tau_counter_novel", + format: (val) => Number(val).toFixed(2), + setValue: (val) => { nai_settings.mirostat_tau = Number(val).toFixed(2); }, + }, + { + sliderId: "#mirostat_lr_novel", + counterId: "#mirostat_lr_counter_novel", + format: (val) => Number(val).toFixed(2), + setValue: (val) => { nai_settings.mirostat_lr = Number(val).toFixed(2); }, + }, { sliderId: "#cfg_scale_novel", counterId: "#cfg_scale_counter_novel", @@ -298,6 +328,9 @@ export function getNovelGenerationData(finalPromt, this_settings, this_amount_ge "top_p": parseFloat(nai_settings.top_p), "top_k": parseInt(nai_settings.top_k), "typical_p": parseFloat(nai_settings.typical_p), + "top_g": parseFloat(nai_settings.top_g), + "mirostat_lr": parseFloat(nai_settings.mirostat_lr), + "mirostat_tau": parseFloat(nai_settings.mirostat_tau), "cfg_scale": parseFloat(nai_settings.cfg_scale), "cfg_uc": "", "phrase_rep_pen": nai_settings.phrase_rep_pen, diff --git a/server.js b/server.js index cb7465565..9f6730b8e 100644 --- a/server.js +++ b/server.js @@ -1872,6 +1872,9 @@ app.post("/generate_novelai", jsonParser, async function (request, response_gene "top_p": request.body.top_p, "top_k": request.body.top_k, "typical_p": request.body.typical_p, + "top_g": request.body.top_g, + "mirostat_lr": request.body.mirostat_lr, + "mirostat_tau": request.body.mirostat_tau, "cfg_scale": request.body.cfg_scale, "cfg_uc": request.body.cfg_uc, "phrase_rep_pen": request.body.phrase_rep_pen, From 71c60c3c61a11bf0aa1be51e8c954100fabe3f1c Mon Sep 17 00:00:00 2001 From: RossAscends <124905043+RossAscends@users.noreply.github.com> Date: Sat, 12 Aug 2023 16:25:49 +0900 Subject: [PATCH 2/5] hide proxy password from view --- public/index.html | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/public/index.html b/public/index.html index c33e008d2..afb8bffc9 100644 --- a/public/index.html +++ b/public/index.html @@ -555,7 +555,7 @@
- +
@@ -838,8 +838,7 @@
Preamble -
+
@@ -847,8 +846,7 @@ Use style tags to modify the writing style of the output
- +
@@ -3860,7 +3858,8 @@
Will be automatically added as the Author's Note for all new chats. -
+ +
Tokens: 0
@@ -4018,4 +4017,4 @@ - + \ No newline at end of file From 82f6d117954ec26c18fba47b31f30770619caf56 Mon Sep 17 00:00:00 2001 From: Cohee1207 <18619528+Cohee1207@users.noreply.github.com> Date: Sat, 12 Aug 2023 13:10:41 +0300 Subject: [PATCH 3/5] Add lazy chat messages rendering --- public/index.html | 16 ++++++++++++++++ public/script.js | 21 +++++++++++++++++++++ public/scripts/power-user.js | 7 +++++++ 3 files changed, 44 insertions(+) diff --git a/public/index.html b/public/index.html index 447023d13..cc376206a 100644 --- a/public/index.html +++ b/public/index.html @@ -2472,6 +2472,22 @@
+
+
+ Lazy Chat Loading
+ # of messages (0 = disabled) +
+
+
+ +
+ 0 + 50 + 100 +
+
+
+
Avatar Style: