mirror of
https://github.com/SillyTavern/SillyTavern.git
synced 2025-06-05 21:59:27 +02:00
Fix oobabooga API: add BOS token options, custom stopping string
This commit is contained in:
@ -243,6 +243,12 @@
|
|||||||
Do Sample
|
Do Sample
|
||||||
</label>
|
</label>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="range-block">
|
||||||
|
<label class="checkbox_label" for="add_bos_token_textgenerationwebui" title="Add the bos_token to the beginning of prompts. Disabling this can make the replies more creative.">
|
||||||
|
<input type="checkbox" id="add_bos_token_textgenerationwebui" />
|
||||||
|
Add BOS Token
|
||||||
|
</label>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div id="range_block_openai">
|
<div id="range_block_openai">
|
||||||
<div class="range-block">
|
<div class="range-block">
|
||||||
|
@ -976,6 +976,10 @@ function substituteParams(content, _name1, _name2) {
|
|||||||
return content;
|
return content;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function getStoppingStrings() {
|
||||||
|
return [`\n${name1}:`];
|
||||||
|
}
|
||||||
|
|
||||||
function getSlashCommand(message, type) {
|
function getSlashCommand(message, type) {
|
||||||
if (type == "regenerate" || type == "swipe") {
|
if (type == "regenerate" || type == "swipe") {
|
||||||
return null;
|
return null;
|
||||||
@ -1657,6 +1661,8 @@ async function Generate(type, automatic_trigger, force_name2) {
|
|||||||
'length_penalty': textgenerationwebui_settings.length_penalty,
|
'length_penalty': textgenerationwebui_settings.length_penalty,
|
||||||
'early_stopping': textgenerationwebui_settings.early_stopping,
|
'early_stopping': textgenerationwebui_settings.early_stopping,
|
||||||
'seed': textgenerationwebui_settings.seed,
|
'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)] };
|
generate_data = { "data": [JSON.stringify(data)] };
|
||||||
|
@ -23,6 +23,8 @@ let textgenerationwebui_settings = {
|
|||||||
early_stopping: false,
|
early_stopping: false,
|
||||||
seed: -1,
|
seed: -1,
|
||||||
preset: 'Default',
|
preset: 'Default',
|
||||||
|
add_bos_token: true,
|
||||||
|
custom_stopping_strings: [],
|
||||||
};
|
};
|
||||||
|
|
||||||
let textgenerationwebui_presets = [];
|
let textgenerationwebui_presets = [];
|
||||||
@ -43,6 +45,7 @@ const setting_names = [
|
|||||||
"do_sample",
|
"do_sample",
|
||||||
"early_stopping",
|
"early_stopping",
|
||||||
"seed",
|
"seed",
|
||||||
|
"add_bos_token",
|
||||||
];
|
];
|
||||||
|
|
||||||
function selectPreset(name) {
|
function selectPreset(name) {
|
||||||
|
Reference in New Issue
Block a user