mirror of
https://github.com/SillyTavern/SillyTavern.git
synced 2025-06-05 21:59:27 +02:00
Move Novel settings to another file
This commit is contained in:
@@ -82,6 +82,7 @@ import {
|
|||||||
} from "./scripts/openai.js";
|
} from "./scripts/openai.js";
|
||||||
|
|
||||||
import {
|
import {
|
||||||
|
getNovelGenerationData,
|
||||||
getNovelTier,
|
getNovelTier,
|
||||||
loadNovelPreset,
|
loadNovelPreset,
|
||||||
loadNovelSettings,
|
loadNovelSettings,
|
||||||
@@ -3001,36 +3002,6 @@ function setInContextMessages(lastmsg, type) {
|
|||||||
$('#chat .mes:not([is_system="true"])').eq(-lastmsg).addClass('lastInContext');
|
$('#chat .mes:not([is_system="true"])').eq(-lastmsg).addClass('lastInContext');
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO: move to nai-settings.js
|
|
||||||
function getNovelGenerationData(finalPromt, this_settings, this_amount_gen) {
|
|
||||||
return {
|
|
||||||
"input": finalPromt,
|
|
||||||
"model": nai_settings.model_novel,
|
|
||||||
"use_string": true,
|
|
||||||
"temperature": parseFloat(nai_settings.temp_novel),
|
|
||||||
"max_length": this_amount_gen, // this_settings.max_length, // <= why?
|
|
||||||
"min_length": this_settings.min_length,
|
|
||||||
"tail_free_sampling": parseFloat(nai_settings.tail_free_sampling_novel),
|
|
||||||
"repetition_penalty": parseFloat(nai_settings.rep_pen_novel),
|
|
||||||
"repetition_penalty_range": parseInt(nai_settings.rep_pen_size_novel),
|
|
||||||
"repetition_penalty_slope": parseFloat(nai_settings.rep_pen_slope_novel),
|
|
||||||
"repetition_penalty_frequency": parseFloat(nai_settings.rep_pen_freq_novel),
|
|
||||||
"repetition_penalty_presence": parseFloat(nai_settings.rep_pen_presence_novel),
|
|
||||||
"top_a": this_settings.top_a,
|
|
||||||
"top_p": this_settings.top_p,
|
|
||||||
"top_k": this_settings.top_k,
|
|
||||||
"typical_p": this_settings.typical_p,
|
|
||||||
//"stop_sequences": {{187}},
|
|
||||||
//bad_words_ids = {{50256}, {0}, {1}};
|
|
||||||
//generate_until_sentence = true;
|
|
||||||
"use_cache": false,
|
|
||||||
//use_string = true;
|
|
||||||
"return_full_text": false,
|
|
||||||
"prefix": "vanilla",
|
|
||||||
"order": this_settings.order
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
function getGenerateUrl() {
|
function getGenerateUrl() {
|
||||||
let generate_url = '';
|
let generate_url = '';
|
||||||
if (main_api == 'kobold') {
|
if (main_api == 'kobold') {
|
||||||
|
@@ -130,6 +130,35 @@ const sliders = [
|
|||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
|
||||||
|
export function getNovelGenerationData(finalPromt, this_settings, this_amount_gen) {
|
||||||
|
return {
|
||||||
|
"input": finalPromt,
|
||||||
|
"model": nai_settings.model_novel,
|
||||||
|
"use_string": true,
|
||||||
|
"temperature": parseFloat(nai_settings.temp_novel),
|
||||||
|
"max_length": this_amount_gen, // this_settings.max_length, // <= why?
|
||||||
|
"min_length": this_settings.min_length,
|
||||||
|
"tail_free_sampling": parseFloat(nai_settings.tail_free_sampling_novel),
|
||||||
|
"repetition_penalty": parseFloat(nai_settings.rep_pen_novel),
|
||||||
|
"repetition_penalty_range": parseInt(nai_settings.rep_pen_size_novel),
|
||||||
|
"repetition_penalty_slope": parseFloat(nai_settings.rep_pen_slope_novel),
|
||||||
|
"repetition_penalty_frequency": parseFloat(nai_settings.rep_pen_freq_novel),
|
||||||
|
"repetition_penalty_presence": parseFloat(nai_settings.rep_pen_presence_novel),
|
||||||
|
"top_a": this_settings.top_a,
|
||||||
|
"top_p": this_settings.top_p,
|
||||||
|
"top_k": this_settings.top_k,
|
||||||
|
"typical_p": this_settings.typical_p,
|
||||||
|
//"stop_sequences": {{187}},
|
||||||
|
//bad_words_ids = {{50256}, {0}, {1}};
|
||||||
|
//generate_until_sentence = true;
|
||||||
|
"use_cache": false,
|
||||||
|
//use_string = true;
|
||||||
|
"return_full_text": false,
|
||||||
|
"prefix": "vanilla",
|
||||||
|
"order": this_settings.order
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
$(document).ready(function () {
|
$(document).ready(function () {
|
||||||
sliders.forEach(slider => {
|
sliders.forEach(slider => {
|
||||||
$(document).on("input", slider.sliderId, function () {
|
$(document).on("input", slider.sliderId, function () {
|
||||||
|
@@ -580,6 +580,9 @@ app.post("/getstatus", jsonParser, async function (request, response_getstatus =
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
client.get(url, args, function (data, response) {
|
client.get(url, args, function (data, response) {
|
||||||
|
if (typeof data !== 'object') {
|
||||||
|
data = {};
|
||||||
|
}
|
||||||
if (response.statusCode == 200) {
|
if (response.statusCode == 200) {
|
||||||
data.version = version;
|
data.version = version;
|
||||||
if (data.result != "ReadOnly") {
|
if (data.result != "ReadOnly") {
|
||||||
|
Reference in New Issue
Block a user