Merge branch 'staging' into connection-profile-omit
| @@ -1310,7 +1310,7 @@ | ||
| 1310 | 1310 | </div> |
| 1311 | 1311 | </div> |
| 1312 | 1312 | |
| 1313 | 1313 | <div data-tg-type="koboldcpp, aphrodite, tabby" id="xtc_block" class="wide100p"> |
| 1314 | 1314 | <h4 class="wide100p textAlignCenter"> |
| 1315 | 1315 | <label data-i18n="Exclude Top Choices (XTC)">Exclude Top Choices (XTC)</label> |
| 1316 | 1316 | <a href="https://github.com/oobabooga/text-generation-webui/pull/6335" target="_blank"> |
| @@ -4863,7 +4863,7 @@ export function getMaxContextSize(overrideResponseLength = null) { | ||
| 4863 | 4863 | this_max_context = Math.min(max_context, 8192); |
| 4864 | 4864 | |
| 4865 | 4865 | // Added special tokens and whatnot |
| 4866 | 4866 | this_max_context -= 110; |
| 4867 | 4867 | } |
| 4868 | 4868 | |
| 4869 | 4869 | this_max_context = this_max_context - (overrideResponseLength || amount_gen); |
| @@ -492,11 +492,37 @@ function getBadWordPermutations(text) { | ||
| 492 | 492 | |
| 493 | 493 | export function getNovelGenerationData(finalPrompt, settings, maxLength, isImpersonate, isContinue, _cfgValues, type) { |
| 494 | 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'); | |
| 495 | 497 | |
| 496 | 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 | 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 | 526 | : undefined; |
| 501 | 527 | |
| 502 | 528 | const badWordIds = (tokenizerType !== tokenizers.NONE) |
| @@ -515,11 +541,9 @@ export function getNovelGenerationData(finalPrompt, settings, maxLength, isImper | ||
| 515 | 541 | console.log(finalPrompt); |
| 516 | 542 | } |
| 517 | 543 | |
| 518 | - const isKayra = nai_settings.model_novel.includes('kayra'); | |
| 519 | - const isErato = nai_settings.model_novel.includes('erato'); | |
| 520 | 544 | |
| 521 | 545 | if (isErato) { |
| 522 | 546 | finalPrompt = '<|startoftext|><|reserved_special_token81|>' + finalPrompt; |
| 523 | 547 | } |
| 524 | 548 | |
| 525 | 549 | const adjustedMaxLength = (isKayra || isErato) ? getKayraMaxResponseTokens() : maximum_output_length; |
| @@ -143,7 +143,7 @@ function selectSystemPromptCallback(args, name) { | ||
| 143 | 143 | foundName = result[0].item; |
| 144 | 144 | } |
| 145 | 145 | |
| 146 | 146 | $select.val(foundName).trigger('inputchange'); |
| 147 | 147 | !quiet && toastr.success(`System prompt "${foundName}" selected`); |
| 148 | 148 | return foundName; |
| 149 | 149 | } |
| @@ -3245,8 +3245,9 @@ grammarly-extension { | ||
| 3245 | 3245 | } |
| 3246 | 3246 | |
| 3247 | 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 | 3251 | min-width: var(--sheldWidth); |
| 3251 | 3252 | } |
| 3252 | 3253 | |