Merge branch 'staging' into connection-profile-omit

8083431202f9bd9b5c9517fb9ec6596202cce4ca

Cohee <18619528+Cohee1207@users.noreply.github.com>

5 files changed, +35 -10Ignore whitespace
public/index.html+1 -1
@@ -1310,7 +1310,7 @@
1310 </div>1310 </div>
1311 </div>1311 </div>
13121312
1313 <div data-tg-type="koboldcpp, aphrodite" id="xtc_block" class="wide100p">1313 <div data-tg-type="koboldcpp, aphrodite, tabby" id="xtc_block" class="wide100p">
1314 <h4 class="wide100p textAlignCenter">1314 <h4 class="wide100p textAlignCenter">
1315 <label data-i18n="Exclude Top Choices (XTC)">Exclude Top Choices (XTC)</label>1315 <label data-i18n="Exclude Top Choices (XTC)">Exclude Top Choices (XTC)</label>
1316 <a href="https://github.com/oobabooga/text-generation-webui/pull/6335" target="_blank">1316 <a href="https://github.com/oobabooga/text-generation-webui/pull/6335" target="_blank">
public/script.js+1 -1
@@ -4863,7 +4863,7 @@ export function getMaxContextSize(overrideResponseLength = null) {
4863 this_max_context = Math.min(max_context, 8192);4863 this_max_context = Math.min(max_context, 8192);
48644864
4865 // Added special tokens and whatnot4865 // Added special tokens and whatnot
4866 this_max_context -= 1;4866 this_max_context -= 10;
4867 }4867 }
48684868
4869 this_max_context = this_max_context - (overrideResponseLength || amount_gen);4869 this_max_context = this_max_context - (overrideResponseLength || amount_gen);
public/scripts/nai-settings.js+29 -5
@@ -492,11 +492,37 @@ function getBadWordPermutations(text) {
492492
493export function getNovelGenerationData(finalPrompt, settings, maxLength, isImpersonate, isContinue, _cfgValues, type) {493export function getNovelGenerationData(finalPrompt, settings, maxLength, isImpersonate, isContinue, _cfgValues, type) {
494 console.debug('NovelAI generation data for', type);494 console.debug('NovelAI generation data for', type);
495 const isKayra = nai_settings.model_novel.includes('kayra');
496 const isErato = nai_settings.model_novel.includes('erato');
495497
496 const tokenizerType = getTokenizerTypeForModel(nai_settings.model_novel);498 const tokenizerType = getTokenizerTypeForModel(nai_settings.model_novel);
499 const stoppingStrings = getStoppingStrings(isImpersonate, isContinue);
500
501 // Llama 3 tokenizer, huh?
502 if (isErato) {
503 const additionalStopStrings = [];
504 for (const stoppingString of stoppingStrings) {
505 if (stoppingString.startsWith('\n')) {
506 additionalStopStrings.push('.' + stoppingString);
507 additionalStopStrings.push('!' + stoppingString);
508 additionalStopStrings.push('?' + stoppingString);
509 additionalStopStrings.push('*' + stoppingString);
510 additionalStopStrings.push('"' + stoppingString);
511 additionalStopStrings.push('_' + stoppingString);
512 additionalStopStrings.push('...' + stoppingString);
513 additionalStopStrings.push('."' + stoppingString);
514 additionalStopStrings.push('?"' + stoppingString);
515 additionalStopStrings.push('!"' + stoppingString);
516 additionalStopStrings.push('.*' + stoppingString);
517 additionalStopStrings.push(')' + stoppingString);
518 }
519 }
520 stoppingStrings.push(...additionalStopStrings);
521 }
522
523 const MAX_STOP_SEQUENCES = 1024;
497 const stopSequences = (tokenizerType !== tokenizers.NONE)524 const stopSequences = (tokenizerType !== tokenizers.NONE)
498 ? getStoppingStrings(isImpersonate, isContinue)525 ? stoppingStrings.slice(0, MAX_STOP_SEQUENCES).map(t => getTextTokens(tokenizerType, t))
499 .map(t => getTextTokens(tokenizerType, t))
500 : undefined;526 : undefined;
501527
502 const badWordIds = (tokenizerType !== tokenizers.NONE)528 const badWordIds = (tokenizerType !== tokenizers.NONE)
@@ -515,11 +541,9 @@ export function getNovelGenerationData(finalPrompt, settings, maxLength, isImper
515 console.log(finalPrompt);541 console.log(finalPrompt);
516 }542 }
517543
518 const isKayra = nai_settings.model_novel.includes('kayra');
519 const isErato = nai_settings.model_novel.includes('erato');
520544
521 if (isErato) {545 if (isErato) {
522 finalPrompt = '<|startoftext|>' + finalPrompt;546 finalPrompt = '<|startoftext|><|reserved_special_token81|>' + finalPrompt;
523 }547 }
524548
525 const adjustedMaxLength = (isKayra || isErato) ? getKayraMaxResponseTokens() : maximum_output_length;549 const adjustedMaxLength = (isKayra || isErato) ? getKayraMaxResponseTokens() : maximum_output_length;
public/scripts/sysprompt.js+1 -1
@@ -143,7 +143,7 @@ function selectSystemPromptCallback(args, name) {
143 foundName = result[0].item;143 foundName = result[0].item;
144 }144 }
145145
146 $select.val(foundName).trigger('input');146 $select.val(foundName).trigger('change');
147 !quiet && toastr.success(`System prompt "${foundName}" selected`);147 !quiet && toastr.success(`System prompt "${foundName}" selected`);
148 return foundName;148 return foundName;
149}149}
public/style.css+3 -2
@@ -3245,8 +3245,9 @@ grammarly-extension {
3245}3245}
32463246
3247.wide_dialogue_popup {3247.wide_dialogue_popup {
3248 aspect-ratio: 1 / 1;3248 /* FIXME: Chrome 129 broke max-height for aspect-ratio sized elements */
3249 width: unset !important;3249 /* aspect-ratio: 1 / 1; */
3250 /* width: unset !important; */
3250 min-width: var(--sheldWidth);3251 min-width: var(--sheldWidth);
3251}3252}
32523253