mirror of
https://github.com/SillyTavern/SillyTavern.git
synced 2025-06-05 21:59:27 +02:00
Add NAI preamble to start of chat buffer
This commit is contained in:
@ -13,6 +13,8 @@ export {
|
||||
getNovelTier,
|
||||
};
|
||||
|
||||
const default_preamble = "[ Style: chat, complex, sensory, visceral ]";
|
||||
|
||||
const nai_settings = {
|
||||
temperature: 0.5,
|
||||
repetition_penalty: 1,
|
||||
@ -29,6 +31,7 @@ const nai_settings = {
|
||||
model_novel: "euterpe-v2",
|
||||
preset_settings_novel: "Classic-Euterpe",
|
||||
streaming_novel: false,
|
||||
nai_preamble: default_preamble,
|
||||
};
|
||||
|
||||
const nai_tiers = {
|
||||
@ -76,6 +79,7 @@ function loadNovelSettings(settings) {
|
||||
$(`#model_novel_select option[value=${nai_settings.model_novel}]`).attr("selected", true);
|
||||
$('#model_novel_select').val(nai_settings.model_novel);
|
||||
|
||||
if (settings.nai_preamble !== undefined) nai_settings.nai_preamble = settings.nai_preamble;
|
||||
nai_settings.preset_settings_novel = settings.preset_settings_novel;
|
||||
nai_settings.temperature = settings.temperature;
|
||||
nai_settings.repetition_penalty = settings.repetition_penalty;
|
||||
@ -157,6 +161,7 @@ function loadNovelSettingsUi(ui_settings) {
|
||||
$("#phrase_rep_pen_counter_novel").text(getPhraseRepPenCounter(ui_settings.phrase_rep_pen));
|
||||
$("#min_length_novel").val(ui_settings.min_length);
|
||||
$("#min_length_counter_novel").text(Number(ui_settings.min_length).toFixed(0));
|
||||
$('#nai_preamble_textarea').val(ui_settings.nai_preamble);
|
||||
|
||||
$("#streaming_novel").prop('checked', ui_settings.streaming_novel);
|
||||
}
|
||||
@ -334,6 +339,17 @@ export async function generateNovelWithStreaming(generate_data, signal) {
|
||||
}
|
||||
}
|
||||
|
||||
$("#nai_preamble_textarea").on('input', function () {
|
||||
nai_settings.nai_preamble = $('#nai_preamble_textarea').val();
|
||||
saveSettingsDebounced();
|
||||
});
|
||||
|
||||
$("#nai_preamble_restore").on('click', function () {
|
||||
nai_settings.nai_preamble = default_preamble;
|
||||
$('#nai_preamble_textarea').val(nai_settings.nai_preamble);
|
||||
saveSettingsDebounced();
|
||||
});
|
||||
|
||||
$(document).ready(function () {
|
||||
sliders.forEach(slider => {
|
||||
$(document).on("input", slider.sliderId, function () {
|
||||
|
Reference in New Issue
Block a user