mirror of
https://github.com/SillyTavern/SillyTavern.git
synced 2025-06-05 21:59:27 +02:00
Option to unlock max context size
This commit is contained in:
@@ -175,6 +175,18 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="max_context_unlocked_block">
|
||||
<label class="checkbox_label">
|
||||
<input id="max_context_unlocked" type="checkbox" />
|
||||
Unlocked
|
||||
<div id="max_context_unlocked_warning">
|
||||
<b class="neutral_warning">ATTENTION!</b>
|
||||
Only select models support context sizes greater than 2048 tokens.
|
||||
Proceed only if you know what you're doing.
|
||||
</div>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
<hr>
|
||||
</div>
|
||||
|
@@ -3235,12 +3235,6 @@ async function getSettings(type) {
|
||||
"true"
|
||||
);
|
||||
|
||||
$("#max_context").val(max_context);
|
||||
$("#max_context_counter").text(`${max_context}`);
|
||||
|
||||
$("#amount_gen").val(amount_gen);
|
||||
$("#amount_gen_counter").text(`${amount_gen}`);
|
||||
|
||||
swipes = settings.swipes !== undefined ? !!settings.swipes : true; // enable swipes by default
|
||||
$('#swipes-checkbox').prop('checked', swipes); /// swipecode
|
||||
//console.log('getSettings -- swipes = ' + swipes + '. toggling box');
|
||||
@@ -3272,6 +3266,13 @@ async function getSettings(type) {
|
||||
// Load- character tags
|
||||
loadTagsSettings(settings);
|
||||
|
||||
// Set context size after loading power user (may override the max value)
|
||||
$("#max_context").val(max_context);
|
||||
$("#max_context_counter").text(`${max_context}`);
|
||||
|
||||
$("#amount_gen").val(amount_gen);
|
||||
$("#amount_gen_counter").text(`${amount_gen}`);
|
||||
|
||||
//Enable GUI deference settings if GUI is selected for Kobold
|
||||
if (main_api === "kobold") {
|
||||
}
|
||||
|
@@ -27,6 +27,9 @@ export {
|
||||
send_on_enter_options,
|
||||
};
|
||||
|
||||
const MAX_CONTEXT_DEFAULT = 2048;
|
||||
const MAX_CONTEXT_UNLOCKED = 65536;
|
||||
|
||||
const avatar_styles = {
|
||||
ROUND: 0,
|
||||
RECTANGULAR: 1,
|
||||
@@ -111,6 +114,7 @@ let power_user = {
|
||||
allow_name2_display: false,
|
||||
hotswap_enabled: true,
|
||||
timer_enabled: true,
|
||||
max_context_unlocked: false,
|
||||
|
||||
instruct: {
|
||||
enabled: false,
|
||||
@@ -534,6 +538,28 @@ function loadPowerUserSettings(settings, data) {
|
||||
sortCharactersList();
|
||||
reloadMarkdownProcessor(power_user.render_formulas);
|
||||
loadInstructMode();
|
||||
loadMaxContextUnlocked();
|
||||
}
|
||||
|
||||
function loadMaxContextUnlocked() {
|
||||
$('#max_context_unlocked').prop('checked', power_user.max_context_unlocked);
|
||||
$('#max_context_unlocked').on('change', function() {
|
||||
power_user.max_context_unlocked = !!$(this).prop('checked');
|
||||
switchMaxContextSize();
|
||||
saveSettingsDebounced();
|
||||
});
|
||||
switchMaxContextSize();
|
||||
}
|
||||
|
||||
function switchMaxContextSize() {
|
||||
const element = $('#max_context');
|
||||
const maxValue = power_user.max_context_unlocked ? MAX_CONTEXT_UNLOCKED : MAX_CONTEXT_DEFAULT;
|
||||
element.attr('max', maxValue);
|
||||
const value = Number(element.val());
|
||||
|
||||
if (value >= maxValue) {
|
||||
element.val(maxValue).trigger('input');
|
||||
}
|
||||
}
|
||||
|
||||
function loadInstructMode() {
|
||||
|
@@ -1923,6 +1923,7 @@ input[type='checkbox']:not(#nav-toggle):not(#rm_button_panel_pin):not(#lm_button
|
||||
display: flex;
|
||||
grid-gap: 10px;
|
||||
flex-wrap: wrap;
|
||||
justify-content: space-evenly;
|
||||
}
|
||||
|
||||
#user_avatar_block .avatar {
|
||||
@@ -3673,6 +3674,18 @@ toolcool-color-picker {
|
||||
color: rgba(255, 0, 0, 0.5)
|
||||
}
|
||||
|
||||
.max_context_unlocked_block .checkbox_label {
|
||||
flex-wrap: wrap;
|
||||
}
|
||||
|
||||
#max_context_unlocked_warning {
|
||||
flex-basis: 100%;
|
||||
}
|
||||
|
||||
#max_context_unlocked:not(:checked) + div {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.textarea_compact {
|
||||
font-size: calc(var(--mainFontSize) * 0.9);
|
||||
line-height: 1.2;
|
||||
|
Reference in New Issue
Block a user