diff --git a/public/index.html b/public/index.html
index 94d920c0a..28961c119 100644
--- a/public/index.html
+++ b/public/index.html
@@ -558,6 +558,12 @@
Ban the eos_token. This forces the model to never end the generation prematurely.
+
+
+
+ Skip Special Tokens
+
+
Beam search
diff --git a/public/script.js b/public/script.js
index de51019e9..dffde3c07 100644
--- a/public/script.js
+++ b/public/script.js
@@ -1014,8 +1014,8 @@ function substituteParams(content, _name1, _name2) {
}
function getStoppingStrings(isImpersonate) {
- const charString = [`\n${name2}: `];
- const userString = is_pygmalion ? [`\nYou: `] : [`\n${name1}: `];
+ const charString = `"\n${name2}: "`;
+ const userString = is_pygmalion ? `"\nYou: "` : `"\n${name1}: "`;
return isImpersonate ? charString : userString;
}
@@ -1886,9 +1886,10 @@ async function Generate(type, automatic_trigger, force_name2) {
'early_stopping': textgenerationwebui_settings.early_stopping,
'seed': textgenerationwebui_settings.seed,
'add_bos_token': textgenerationwebui_settings.add_bos_token,
- 'custom_stopping_strings': getStoppingStrings(isImpersonate).concat(textgenerationwebui_settings.custom_stopping_strings),
+ 'custom_stopping_strings': JSON.stringify(getStoppingStrings(isImpersonate)),
'truncation_length': max_context,
'ban_eos_token': textgenerationwebui_settings.ban_eos_token,
+ 'skip_special_tokens': textgenerationwebui_settings.skip_special_tokens,
}
];
generate_data = { "data": [JSON.stringify(data)] };
diff --git a/public/scripts/textgen-settings.js b/public/scripts/textgen-settings.js
index 2916ec4fd..918d1995e 100644
--- a/public/scripts/textgen-settings.js
+++ b/public/scripts/textgen-settings.js
@@ -31,6 +31,7 @@ let textgenerationwebui_settings = {
ban_eos_token: false,
streaming: false,
fn_index: 34,
+ skip_special_tokens: true,
};
let textgenerationwebui_presets = [];
@@ -54,6 +55,7 @@ const setting_names = [
"add_bos_token",
"ban_eos_token",
"fn_index",
+ "skip_special_tokens",
];
function selectPreset(name) {