mirror of
https://github.com/SillyTavern/SillyTavern.git
synced 2025-02-10 17:10:45 +01:00
Merge branch 'staging' into connection-profile-omit
This commit is contained in:
commit
8083431202
@ -1310,7 +1310,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div data-tg-type="koboldcpp, aphrodite" id="xtc_block" class="wide100p">
|
<div data-tg-type="koboldcpp, aphrodite, tabby" id="xtc_block" class="wide100p">
|
||||||
<h4 class="wide100p textAlignCenter">
|
<h4 class="wide100p textAlignCenter">
|
||||||
<label data-i18n="Exclude Top Choices (XTC)">Exclude Top Choices (XTC)</label>
|
<label data-i18n="Exclude Top Choices (XTC)">Exclude Top Choices (XTC)</label>
|
||||||
<a href="https://github.com/oobabooga/text-generation-webui/pull/6335" target="_blank">
|
<a href="https://github.com/oobabooga/text-generation-webui/pull/6335" target="_blank">
|
||||||
|
@ -4863,7 +4863,7 @@ export function getMaxContextSize(overrideResponseLength = null) {
|
|||||||
this_max_context = Math.min(max_context, 8192);
|
this_max_context = Math.min(max_context, 8192);
|
||||||
|
|
||||||
// Added special tokens and whatnot
|
// Added special tokens and whatnot
|
||||||
this_max_context -= 1;
|
this_max_context -= 10;
|
||||||
}
|
}
|
||||||
|
|
||||||
this_max_context = this_max_context - (overrideResponseLength || amount_gen);
|
this_max_context = this_max_context - (overrideResponseLength || amount_gen);
|
||||||
|
@ -492,11 +492,37 @@ function getBadWordPermutations(text) {
|
|||||||
|
|
||||||
export function getNovelGenerationData(finalPrompt, settings, maxLength, isImpersonate, isContinue, _cfgValues, type) {
|
export function getNovelGenerationData(finalPrompt, settings, maxLength, isImpersonate, isContinue, _cfgValues, type) {
|
||||||
console.debug('NovelAI generation data for', type);
|
console.debug('NovelAI generation data for', type);
|
||||||
|
const isKayra = nai_settings.model_novel.includes('kayra');
|
||||||
|
const isErato = nai_settings.model_novel.includes('erato');
|
||||||
|
|
||||||
const tokenizerType = getTokenizerTypeForModel(nai_settings.model_novel);
|
const tokenizerType = getTokenizerTypeForModel(nai_settings.model_novel);
|
||||||
|
const stoppingStrings = getStoppingStrings(isImpersonate, isContinue);
|
||||||
|
|
||||||
|
// Llama 3 tokenizer, huh?
|
||||||
|
if (isErato) {
|
||||||
|
const additionalStopStrings = [];
|
||||||
|
for (const stoppingString of stoppingStrings) {
|
||||||
|
if (stoppingString.startsWith('\n')) {
|
||||||
|
additionalStopStrings.push('.' + stoppingString);
|
||||||
|
additionalStopStrings.push('!' + stoppingString);
|
||||||
|
additionalStopStrings.push('?' + stoppingString);
|
||||||
|
additionalStopStrings.push('*' + stoppingString);
|
||||||
|
additionalStopStrings.push('"' + stoppingString);
|
||||||
|
additionalStopStrings.push('_' + stoppingString);
|
||||||
|
additionalStopStrings.push('...' + stoppingString);
|
||||||
|
additionalStopStrings.push('."' + stoppingString);
|
||||||
|
additionalStopStrings.push('?"' + stoppingString);
|
||||||
|
additionalStopStrings.push('!"' + stoppingString);
|
||||||
|
additionalStopStrings.push('.*' + stoppingString);
|
||||||
|
additionalStopStrings.push(')' + stoppingString);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
stoppingStrings.push(...additionalStopStrings);
|
||||||
|
}
|
||||||
|
|
||||||
|
const MAX_STOP_SEQUENCES = 1024;
|
||||||
const stopSequences = (tokenizerType !== tokenizers.NONE)
|
const stopSequences = (tokenizerType !== tokenizers.NONE)
|
||||||
? getStoppingStrings(isImpersonate, isContinue)
|
? stoppingStrings.slice(0, MAX_STOP_SEQUENCES).map(t => getTextTokens(tokenizerType, t))
|
||||||
.map(t => getTextTokens(tokenizerType, t))
|
|
||||||
: undefined;
|
: undefined;
|
||||||
|
|
||||||
const badWordIds = (tokenizerType !== tokenizers.NONE)
|
const badWordIds = (tokenizerType !== tokenizers.NONE)
|
||||||
@ -515,11 +541,9 @@ export function getNovelGenerationData(finalPrompt, settings, maxLength, isImper
|
|||||||
console.log(finalPrompt);
|
console.log(finalPrompt);
|
||||||
}
|
}
|
||||||
|
|
||||||
const isKayra = nai_settings.model_novel.includes('kayra');
|
|
||||||
const isErato = nai_settings.model_novel.includes('erato');
|
|
||||||
|
|
||||||
if (isErato) {
|
if (isErato) {
|
||||||
finalPrompt = '<|startoftext|>' + finalPrompt;
|
finalPrompt = '<|startoftext|><|reserved_special_token81|>' + finalPrompt;
|
||||||
}
|
}
|
||||||
|
|
||||||
const adjustedMaxLength = (isKayra || isErato) ? getKayraMaxResponseTokens() : maximum_output_length;
|
const adjustedMaxLength = (isKayra || isErato) ? getKayraMaxResponseTokens() : maximum_output_length;
|
||||||
|
@ -143,7 +143,7 @@ function selectSystemPromptCallback(args, name) {
|
|||||||
foundName = result[0].item;
|
foundName = result[0].item;
|
||||||
}
|
}
|
||||||
|
|
||||||
$select.val(foundName).trigger('input');
|
$select.val(foundName).trigger('change');
|
||||||
!quiet && toastr.success(`System prompt "${foundName}" selected`);
|
!quiet && toastr.success(`System prompt "${foundName}" selected`);
|
||||||
return foundName;
|
return foundName;
|
||||||
}
|
}
|
||||||
|
@ -3245,8 +3245,9 @@ grammarly-extension {
|
|||||||
}
|
}
|
||||||
|
|
||||||
.wide_dialogue_popup {
|
.wide_dialogue_popup {
|
||||||
aspect-ratio: 1 / 1;
|
/* FIXME: Chrome 129 broke max-height for aspect-ratio sized elements */
|
||||||
width: unset !important;
|
/* aspect-ratio: 1 / 1; */
|
||||||
|
/* width: unset !important; */
|
||||||
min-width: var(--sheldWidth);
|
min-width: var(--sheldWidth);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user