Improve context slider sanity

This commit is contained in:
Cohee 2023-10-27 13:22:46 +03:00
parent 0c36d113bf
commit 0ad96b6567
2 changed files with 7 additions and 7 deletions

View File

@ -234,11 +234,10 @@
</div>
<div class="range-block-range-and-counter">
<div class="range-block-range">
<input type="range" id="max_context" name="volume" min="512" max="4096" step="512">
<input type="range" id="max_context" name="volume" min="512" max="8192" step="64">
</div>
<div class="range-block-counter" data-randomization-disabled="true">
<input type="number" min="512" max="4096" step="512" data-for="max_context" id="max_context_counter">
<input type="number" min="512" max="8192" step="64" data-for="max_context" id="max_context_counter">
</div>
</div>
</div>

View File

@ -46,8 +46,9 @@ export {
export const MAX_CONTEXT_DEFAULT = 8192;
const MAX_CONTEXT_UNLOCKED = 65536;
const unlockedMaxContextStep = 1024
const unlockedMaxContestMin = 8192
const unlockedMaxContextStep = 256;
const maxContextMin = 512;
const maxContextStep = 64;
const defaultStoryString = "{{#if system}}{{system}}\n{{/if}}{{#if description}}{{description}}\n{{/if}}{{#if personality}}{{char}}'s personality: {{personality}}\n{{/if}}{{#if scenario}}Scenario: {{scenario}}\n{{/if}}{{#if persona}}{{persona}}\n{{/if}}";
const defaultExampleSeparator = '***';
@ -1087,8 +1088,8 @@ function loadMaxContextUnlocked() {
function switchMaxContextSize() {
const elements = [$('#max_context'), $('#rep_pen_range'), $('#rep_pen_range_textgenerationwebui')];
const maxValue = power_user.max_context_unlocked ? MAX_CONTEXT_UNLOCKED : MAX_CONTEXT_DEFAULT;
const minValue = power_user.max_context_unlocked ? 0 : 0;
const steps = power_user.max_context_unlocked ? unlockedMaxContextStep : 256;
const minValue = power_user.max_context_unlocked ? maxContextMin : maxContextMin;
const steps = power_user.max_context_unlocked ? unlockedMaxContextStep : maxContextStep;
for (const element of elements) {
element.attr('max', maxValue);