diff --git a/public/index.html b/public/index.html index da654f3fb..b67ba2715 100644 --- a/public/index.html +++ b/public/index.html @@ -243,6 +243,12 @@ Do Sample +
+ +
diff --git a/public/script.js b/public/script.js index f818e97b5..1543e87c7 100644 --- a/public/script.js +++ b/public/script.js @@ -977,6 +977,10 @@ function substituteParams(content, _name1, _name2) { return content; } +function getStoppingStrings() { + return [`\n${name1}:`]; +} + function getSlashCommand(message, type) { if (type == "regenerate" || type == "swipe") { return null; @@ -1737,6 +1741,8 @@ async function Generate(type, automatic_trigger, force_name2) { 'length_penalty': textgenerationwebui_settings.length_penalty, 'early_stopping': textgenerationwebui_settings.early_stopping, 'seed': textgenerationwebui_settings.seed, + 'add_bos_token': textgenerationwebui_settings.add_bos_token, + 'custom_stopping_strings': getStoppingStrings().concat(textgenerationwebui_settings.custom_stopping_strings), } ]; generate_data = { "data": [JSON.stringify(data)] }; diff --git a/public/scripts/textgen-settings.js b/public/scripts/textgen-settings.js index 3ed545a07..26cca07d1 100644 --- a/public/scripts/textgen-settings.js +++ b/public/scripts/textgen-settings.js @@ -23,6 +23,8 @@ let textgenerationwebui_settings = { early_stopping: false, seed: -1, preset: 'Default', + add_bos_token: true, + custom_stopping_strings: [], }; let textgenerationwebui_presets = []; @@ -43,6 +45,7 @@ const setting_names = [ "do_sample", "early_stopping", "seed", + "add_bos_token", ]; function selectPreset(name) {