Better UI control for phrase rep pen

This commit is contained in:
Cohee
2023-08-14 19:00:36 +03:00
parent c172801b5e
commit 8c759e87cf
2 changed files with 19 additions and 22 deletions

View File

@@ -191,7 +191,6 @@ function loadNovelSettingsUi(ui_settings) {
$("#cfg_scale_novel").val(ui_settings.cfg_scale);
$("#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);
@@ -298,12 +297,6 @@ const sliders = [
format: (val) => `${val}`,
setValue: (val) => { nai_settings.cfg_scale = Number(val).toFixed(2); },
},
{
sliderId: "#phrase_rep_pen_novel",
counterId: "#phrase_rep_pen_counter_novel",
format: (val) => `${val}`,
setValue: (val) => { nai_settings.phrase_rep_pen = getPhraseRepPenString(Number(val).toFixed(0)); },
},
{
sliderId: "#min_length_novel",
counterId: "#min_length_counter_novel",
@@ -463,4 +456,10 @@ $(document).ready(function () {
nai_settings.prefix = $("#nai_prefix").find(":selected").val();
saveSettingsDebounced();
});
$("#phrase_rep_pen_novel", function () {
const val = $("#phrase_rep_pen_novel").find(":selected").val();
nai_settings.phrase_rep_pen = getPhraseRepPenString(Number(val).toFixed(0));
saveSettingsDebounced();
});
});