mirror of
https://github.com/SillyTavern/SillyTavern.git
synced 2025-06-05 21:59:27 +02:00
Add preset settings for TextGen. Thanks oobabooga for compiling them!
This commit is contained in:
15
public/TextGen Settings/Beam Search.settings
Normal file
15
public/TextGen Settings/Beam Search.settings
Normal file
@ -0,0 +1,15 @@
|
||||
{
|
||||
temp: 0.7,
|
||||
top_p: 0.92,
|
||||
top_k: 150,
|
||||
typical_p: 1,
|
||||
rep_pen: 4.5,
|
||||
no_repeat_ngram_size: 2,
|
||||
penalty_alpha: 0,
|
||||
num_beams: 10,
|
||||
length_penalty: 1.4,
|
||||
min_length: 200,
|
||||
encoder_rep_pen: 1,
|
||||
do_sample: true,
|
||||
early_stopping: true
|
||||
}
|
15
public/TextGen Settings/Contrastive Search.settings
Normal file
15
public/TextGen Settings/Contrastive Search.settings
Normal file
@ -0,0 +1,15 @@
|
||||
{
|
||||
temp: 1,
|
||||
top_p: 1,
|
||||
top_k: 4,
|
||||
typical_p: 1,
|
||||
rep_pen: 1,
|
||||
no_repeat_ngram_size: 0,
|
||||
penalty_alpha: 0.6,
|
||||
num_beams: 1,
|
||||
length_penalty: 1,
|
||||
min_length: 0,
|
||||
encoder_rep_pen: 1,
|
||||
do_sample: false,
|
||||
early_stopping: false
|
||||
}
|
15
public/TextGen Settings/Default.settings
Normal file
15
public/TextGen Settings/Default.settings
Normal file
@ -0,0 +1,15 @@
|
||||
{
|
||||
temp: 0.7,
|
||||
top_p: 0.5,
|
||||
top_k: 40,
|
||||
typical_p: 1,
|
||||
rep_pen: 1.2,
|
||||
no_repeat_ngram_size: 0,
|
||||
penalty_alpha: 0,
|
||||
num_beams: 1,
|
||||
length_penalty: 1,
|
||||
min_length: 0,
|
||||
encoder_rep_pen: 1,
|
||||
do_sample: true,
|
||||
early_stopping: false
|
||||
}
|
15
public/TextGen Settings/Deterministic.settings
Normal file
15
public/TextGen Settings/Deterministic.settings
Normal file
@ -0,0 +1,15 @@
|
||||
{
|
||||
temp: 1,
|
||||
top_p: 1,
|
||||
top_k: 50,
|
||||
typical_p: 1,
|
||||
rep_pen: 1,
|
||||
no_repeat_ngram_size: 0,
|
||||
penalty_alpha: 0,
|
||||
num_beams: 1,
|
||||
length_penalty: 1,
|
||||
min_length: 0,
|
||||
encoder_rep_pen: 1,
|
||||
do_sample: false,
|
||||
early_stopping: false
|
||||
}
|
15
public/TextGen Settings/Kobold (Godlike).settings
Normal file
15
public/TextGen Settings/Kobold (Godlike).settings
Normal file
@ -0,0 +1,15 @@
|
||||
{
|
||||
temp: 0.7,
|
||||
top_p: 0.5,
|
||||
top_k: 0,
|
||||
typical_p: 0.19,
|
||||
rep_pen: 1.1,
|
||||
no_repeat_ngram_size: 0,
|
||||
penalty_alpha: 0,
|
||||
num_beams: 1,
|
||||
length_penalty: 1,
|
||||
min_length: 0,
|
||||
encoder_rep_pen: 1,
|
||||
do_sample: true,
|
||||
early_stopping: false
|
||||
}
|
15
public/TextGen Settings/Kobold (Liminal Drift).settings
Normal file
15
public/TextGen Settings/Kobold (Liminal Drift).settings
Normal file
@ -0,0 +1,15 @@
|
||||
{
|
||||
temp: 0.66,
|
||||
top_p: 1,
|
||||
top_k: 0,
|
||||
typical_p: 0.6,
|
||||
rep_pen: 1.1,
|
||||
no_repeat_ngram_size: 0,
|
||||
penalty_alpha: 0,
|
||||
num_beams: 1,
|
||||
length_penalty: 1,
|
||||
min_length: 0,
|
||||
encoder_rep_pen: 1,
|
||||
do_sample: true,
|
||||
early_stopping: false
|
||||
}
|
15
public/TextGen Settings/Naive.settings
Normal file
15
public/TextGen Settings/Naive.settings
Normal file
@ -0,0 +1,15 @@
|
||||
{
|
||||
temp: 0.7,
|
||||
top_p: 0.85,
|
||||
top_k: 50,
|
||||
typical_p: 1,
|
||||
rep_pen: 1,
|
||||
no_repeat_ngram_size: 0,
|
||||
penalty_alpha: 0,
|
||||
num_beams: 1,
|
||||
length_penalty: 1,
|
||||
min_length: 0,
|
||||
encoder_rep_pen: 1,
|
||||
do_sample: true,
|
||||
early_stopping: false
|
||||
}
|
15
public/TextGen Settings/NovelAI (Best Guess).settings
Normal file
15
public/TextGen Settings/NovelAI (Best Guess).settings
Normal file
@ -0,0 +1,15 @@
|
||||
{
|
||||
temp: 0.8,
|
||||
top_p: 0.9,
|
||||
top_k: 100,
|
||||
typical_p: 1,
|
||||
rep_pen: 1.15,
|
||||
no_repeat_ngram_size: 0,
|
||||
penalty_alpha: 0,
|
||||
num_beams: 1,
|
||||
length_penalty: 1,
|
||||
min_length: 0,
|
||||
encoder_rep_pen: 1,
|
||||
do_sample: true,
|
||||
early_stopping: false
|
||||
}
|
15
public/TextGen Settings/NovelAI (Decadence).settings
Normal file
15
public/TextGen Settings/NovelAI (Decadence).settings
Normal file
@ -0,0 +1,15 @@
|
||||
{
|
||||
temp: 1.99,
|
||||
top_p: 1,
|
||||
top_k: 100,
|
||||
typical_p: 0.97,
|
||||
rep_pen: 1,
|
||||
no_repeat_ngram_size: 0,
|
||||
penalty_alpha: 0,
|
||||
num_beams: 1,
|
||||
length_penalty: 1,
|
||||
min_length: 0,
|
||||
encoder_rep_pen: 1,
|
||||
do_sample: true,
|
||||
early_stopping: false
|
||||
}
|
15
public/TextGen Settings/NovelAI (Genesis).settings
Normal file
15
public/TextGen Settings/NovelAI (Genesis).settings
Normal file
@ -0,0 +1,15 @@
|
||||
{
|
||||
temp: 0.63,
|
||||
top_p: 0.98,
|
||||
top_k: 0,
|
||||
typical_p: 1,
|
||||
rep_pen: 1.05,
|
||||
no_repeat_ngram_size: 0,
|
||||
penalty_alpha: 0,
|
||||
num_beams: 1,
|
||||
length_penalty: 1,
|
||||
min_length: 0,
|
||||
encoder_rep_pen: 1,
|
||||
do_sample: true,
|
||||
early_stopping: false
|
||||
}
|
15
public/TextGen Settings/NovelAI (Lycaenidae).settings
Normal file
15
public/TextGen Settings/NovelAI (Lycaenidae).settings
Normal file
@ -0,0 +1,15 @@
|
||||
{
|
||||
temp: 1.99,
|
||||
top_p: 0.85,
|
||||
top_k: 12,
|
||||
typical_p: 1,
|
||||
rep_pen: 1.15,
|
||||
no_repeat_ngram_size: 0,
|
||||
penalty_alpha: 0,
|
||||
num_beams: 1,
|
||||
length_penalty: 1,
|
||||
min_length: 0,
|
||||
encoder_rep_pen: 1,
|
||||
do_sample: true,
|
||||
early_stopping: false
|
||||
}
|
15
public/TextGen Settings/NovelAI (Ouroboros).settings
Normal file
15
public/TextGen Settings/NovelAI (Ouroboros).settings
Normal file
@ -0,0 +1,15 @@
|
||||
{
|
||||
temp: 1.07,
|
||||
top_p: 1,
|
||||
top_k: 100,
|
||||
typical_p: 1,
|
||||
rep_pen: 1.05,
|
||||
no_repeat_ngram_size: 0,
|
||||
penalty_alpha: 0,
|
||||
num_beams: 1,
|
||||
length_penalty: 1,
|
||||
min_length: 0,
|
||||
encoder_rep_pen: 1,
|
||||
do_sample: true,
|
||||
early_stopping: false
|
||||
}
|
15
public/TextGen Settings/NovelAI (Pleasing Results).settings
Normal file
15
public/TextGen Settings/NovelAI (Pleasing Results).settings
Normal file
@ -0,0 +1,15 @@
|
||||
{
|
||||
temp: 0.44,
|
||||
top_p: 1,
|
||||
top_k: 0,
|
||||
typical_p: 1,
|
||||
rep_pen: 1.15,
|
||||
no_repeat_ngram_size: 0,
|
||||
penalty_alpha: 0,
|
||||
num_beams: 1,
|
||||
length_penalty: 1,
|
||||
min_length: 0,
|
||||
encoder_rep_pen: 1,
|
||||
do_sample: true,
|
||||
early_stopping: false
|
||||
}
|
15
public/TextGen Settings/NovelAI (Sphinx Moth).settings
Normal file
15
public/TextGen Settings/NovelAI (Sphinx Moth).settings
Normal file
@ -0,0 +1,15 @@
|
||||
{
|
||||
temp: 1.99,
|
||||
top_p: 0.18,
|
||||
top_k: 30,
|
||||
typical_p: 1,
|
||||
rep_pen: 1.15,
|
||||
no_repeat_ngram_size: 0,
|
||||
penalty_alpha: 0,
|
||||
num_beams: 1,
|
||||
length_penalty: 1,
|
||||
min_length: 0,
|
||||
encoder_rep_pen: 1,
|
||||
do_sample: true,
|
||||
early_stopping: false
|
||||
}
|
15
public/TextGen Settings/NovelAI (Storywriter).settings
Normal file
15
public/TextGen Settings/NovelAI (Storywriter).settings
Normal file
@ -0,0 +1,15 @@
|
||||
{
|
||||
temp: 0.72,
|
||||
top_p: 0.73,
|
||||
top_k: 0,
|
||||
typical_p: 1,
|
||||
rep_pen: 1.1,
|
||||
no_repeat_ngram_size: 0,
|
||||
penalty_alpha: 0,
|
||||
num_beams: 1,
|
||||
length_penalty: 1,
|
||||
min_length: 0,
|
||||
encoder_rep_pen: 1,
|
||||
do_sample: true,
|
||||
early_stopping: false
|
||||
}
|
15
public/TextGen Settings/Pygmalion.settings
Normal file
15
public/TextGen Settings/Pygmalion.settings
Normal file
@ -0,0 +1,15 @@
|
||||
{
|
||||
temp: 0.5,
|
||||
top_p: 0.9,
|
||||
top_k: 0,
|
||||
typical_p: 1,
|
||||
rep_pen: 1.1,
|
||||
no_repeat_ngram_size: 0,
|
||||
penalty_alpha: 0,
|
||||
num_beams: 1,
|
||||
length_penalty: 1,
|
||||
min_length: 0,
|
||||
encoder_rep_pen: 1,
|
||||
do_sample: true,
|
||||
early_stopping: false
|
||||
}
|
@ -264,7 +264,6 @@
|
||||
<div id="textgenerationwebui_api-presets">
|
||||
<h3>Text generation web UI presets</h3>
|
||||
<select id="settings_preset_textgenerationwebui">
|
||||
<option value="gui">Default</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -2047,8 +2047,6 @@ async function getSettings(type) {
|
||||
|
||||
//Load AI model config settings (temp, context length, anchors, and anchor order)
|
||||
|
||||
loadTextGenSettings(settings.textgenerationwebui_settings);
|
||||
|
||||
amount_gen = settings.amount_gen;
|
||||
if (settings.max_context !== undefined)
|
||||
max_context = parseInt(settings.max_context);
|
||||
@ -2079,11 +2077,15 @@ async function getSettings(type) {
|
||||
//console.log('getsettings calling showswipebtns');
|
||||
showSwipeButtons();
|
||||
|
||||
// Kobold
|
||||
loadKoboldSettings(settings);
|
||||
|
||||
//Novel
|
||||
// Novel
|
||||
loadNovelSettings(settings);
|
||||
|
||||
// TextGen
|
||||
loadTextGenSettings(settings);
|
||||
|
||||
// OpenAI
|
||||
loadOpenAISettings(data, settings);
|
||||
|
||||
|
@ -22,8 +22,12 @@ let textgenerationwebui_settings = {
|
||||
do_sample: true,
|
||||
early_stopping: false,
|
||||
seed: -1,
|
||||
preset: 'Default',
|
||||
};
|
||||
|
||||
let textgenerationwebui_presets = [];
|
||||
let textgenerationwebui_preset_names = [];
|
||||
|
||||
const setting_names = [
|
||||
"temp",
|
||||
"rep_pen",
|
||||
@ -41,26 +45,40 @@ const setting_names = [
|
||||
"seed",
|
||||
];
|
||||
|
||||
function loadTextGenSettings(settings) {
|
||||
if (settings) {
|
||||
Object.assign(textgenerationwebui_settings, settings);
|
||||
function selectPreset(name) {
|
||||
const preset = textgenerationwebui_presets[name];
|
||||
|
||||
if (!preset) {
|
||||
return;
|
||||
}
|
||||
|
||||
for (const i of setting_names) {
|
||||
const isCheckbox = $(`#${i}_textgenerationwebui`).attr('type') == 'checkbox';
|
||||
if (isCheckbox) {
|
||||
const val = Boolean(textgenerationwebui_settings[i]);
|
||||
$(`#${i}_textgenerationwebui`).prop('checked', val);
|
||||
}
|
||||
else {
|
||||
const val = parseFloat(textgenerationwebui_settings[i]);
|
||||
$(`#${i}_textgenerationwebui`).val(val);
|
||||
$(`#${i}_counter_textgenerationwebui`).text(val.toFixed(2));
|
||||
}
|
||||
for (const name of setting_names) {
|
||||
const value = preset[name];
|
||||
setSettingByName(name, value);
|
||||
}
|
||||
}
|
||||
|
||||
$(document).ready(function() {
|
||||
function loadTextGenSettings(settings) {
|
||||
textgenerationwebui_presets = settings.textgenerationwebui_presets ?? [];
|
||||
textgenerationwebui_preset_names = settings.textgenerationwebui_preset_names ?? [];
|
||||
Object.assign(textgenerationwebui_settings, settings.textgenerationwebui_settings ?? {});
|
||||
|
||||
if (textgenerationwebui_settings.preset) {
|
||||
$('#settings_preset_textgenerationwebui').val(textgenerationwebui_settings.preset);
|
||||
}
|
||||
|
||||
for (const i of setting_names) {
|
||||
const value = textgenerationwebui_settings[i];
|
||||
setSettingByName(i, value);
|
||||
}
|
||||
}
|
||||
|
||||
$(document).ready(function () {
|
||||
$('#settings_preset_textgenerationwebui').on('change', function() {
|
||||
const presetName = $(this).val();
|
||||
selectPreset(presetName);
|
||||
});
|
||||
|
||||
for (const i of setting_names) {
|
||||
$(`#${i}_textgenerationwebui`).attr("x-setting-id", i);
|
||||
$(document).on("input", `#${i}_textgenerationwebui`, function () {
|
||||
@ -80,4 +98,21 @@ $(document).ready(function() {
|
||||
saveSettingsDebounced();
|
||||
});
|
||||
}
|
||||
})
|
||||
})
|
||||
|
||||
function setSettingByName(i, value) {
|
||||
if (value === null || value === undefined) {
|
||||
return;
|
||||
}
|
||||
|
||||
const isCheckbox = $(`#${i}_textgenerationwebui`).attr('type') == 'checkbox';
|
||||
if (isCheckbox) {
|
||||
const val = Boolean(value);
|
||||
$(`#${i}_textgenerationwebui`).prop('checked', val);
|
||||
}
|
||||
else {
|
||||
const val = parseFloat(value);
|
||||
$(`#${i}_textgenerationwebui`).val(val);
|
||||
$(`#${i}_counter_textgenerationwebui`).text(val.toFixed(2));
|
||||
}
|
||||
}
|
||||
|
29
server.js
29
server.js
@ -102,6 +102,7 @@ const directories = {
|
||||
novelAI_Settings: 'public/NovelAI Settings',
|
||||
koboldAI_Settings: 'public/KoboldAI Settings',
|
||||
openAI_Settings: 'public/OpenAI Settings',
|
||||
textGen_Settings: 'public/TextGen Settings',
|
||||
thumbnails: 'thumbnails/',
|
||||
thumbnailsBg: 'thumbnails/bg/',
|
||||
thumbnailsAvatar: 'thumbnails/avatar/',
|
||||
@ -864,6 +865,8 @@ app.post('/getsettings', jsonParser, (request, response) => { //Wintermute's cod
|
||||
const novelai_setting_names = [];
|
||||
const openai_settings = [];
|
||||
const openai_setting_names = [];
|
||||
const textgenerationwebui_settings = [];
|
||||
const textgenerationwebui_setting_names = [];
|
||||
const settings = fs.readFileSync('public/settings.json', 'utf8', (err, data) => {
|
||||
if (err) return response.sendStatus(500);
|
||||
|
||||
@ -946,6 +949,30 @@ app.post('/getsettings', jsonParser, (request, response) => { //Wintermute's cod
|
||||
openai_setting_names.push(item.replace(/\.[^/.]+$/, ''));
|
||||
});
|
||||
|
||||
// TextGenerationWebUI
|
||||
const textGenFiles = fs
|
||||
.readdirSync(directories.textGen_Settings)
|
||||
.sort(
|
||||
(a, b) =>
|
||||
fs.statSync(path.join(directories.textGen_Settings, a)).mtimeMs -
|
||||
fs.statSync(path.join(directories.textGen_Settings, b)).mtimeMs
|
||||
);
|
||||
|
||||
textGenFiles.forEach(item => {
|
||||
const file = fs.readFileSync(
|
||||
path.join(directories.textGen_Settings, item),
|
||||
'utf8',
|
||||
(err, data) => {
|
||||
if (err) return response.sendStatus(500);
|
||||
|
||||
return data;
|
||||
}
|
||||
);
|
||||
|
||||
textgenerationwebui_settings.push(file);
|
||||
textgenerationwebui_setting_names.push(item.replace(/\.[^/.]+$/, ''));
|
||||
});
|
||||
|
||||
response.send({
|
||||
settings,
|
||||
koboldai_settings,
|
||||
@ -955,6 +982,8 @@ app.post('/getsettings', jsonParser, (request, response) => { //Wintermute's cod
|
||||
novelai_setting_names,
|
||||
openai_settings,
|
||||
openai_setting_names,
|
||||
textgenerationwebui_settings,
|
||||
textgenerationwebui_setting_names,
|
||||
enable_extensions: enableExtensions,
|
||||
});
|
||||
});
|
||||
|
Reference in New Issue
Block a user