Disallow multiswipe for quiet gens
This commit is contained in:
parent
1786b0d340
commit
939e938ba2
|
@ -2774,11 +2774,11 @@ export async function generateRaw(prompt, api, instructOverride) {
|
||||||
break;
|
break;
|
||||||
case 'novel': {
|
case 'novel': {
|
||||||
const novelSettings = novelai_settings[novelai_setting_names[nai_settings.preset_settings_novel]];
|
const novelSettings = novelai_settings[novelai_setting_names[nai_settings.preset_settings_novel]];
|
||||||
generateData = getNovelGenerationData(prompt, novelSettings, amount_gen, false, false, null);
|
generateData = getNovelGenerationData(prompt, novelSettings, amount_gen, false, false, null, 'quiet');
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case 'textgenerationwebui':
|
case 'textgenerationwebui':
|
||||||
generateData = getTextGenGenerationData(prompt, amount_gen, false, false, null);
|
generateData = getTextGenGenerationData(prompt, amount_gen, false, false, null, 'quiet');
|
||||||
break;
|
break;
|
||||||
case 'openai':
|
case 'openai':
|
||||||
generateData = [{ role: 'user', content: prompt.trim() }];
|
generateData = [{ role: 'user', content: prompt.trim() }];
|
||||||
|
@ -3588,11 +3588,11 @@ async function Generate(type, { automatic_trigger, force_name2, resolve, reject,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (main_api == 'textgenerationwebui') {
|
else if (main_api == 'textgenerationwebui') {
|
||||||
generate_data = getTextGenGenerationData(finalPrompt, maxLength, isImpersonate, isContinue, cfgValues);
|
generate_data = getTextGenGenerationData(finalPrompt, maxLength, isImpersonate, isContinue, cfgValues, type);
|
||||||
}
|
}
|
||||||
else if (main_api == 'novel') {
|
else if (main_api == 'novel') {
|
||||||
const presetSettings = novelai_settings[novelai_setting_names[nai_settings.preset_settings_novel]];
|
const presetSettings = novelai_settings[novelai_setting_names[nai_settings.preset_settings_novel]];
|
||||||
generate_data = getNovelGenerationData(finalPrompt, presetSettings, maxLength, isImpersonate, isContinue, cfgValues);
|
generate_data = getNovelGenerationData(finalPrompt, presetSettings, maxLength, isImpersonate, isContinue, cfgValues, type);
|
||||||
}
|
}
|
||||||
else if (main_api == 'openai') {
|
else if (main_api == 'openai') {
|
||||||
let [prompt, counts] = await prepareOpenAIMessages({
|
let [prompt, counts] = await prepareOpenAIMessages({
|
||||||
|
@ -4372,7 +4372,7 @@ function extractMessageFromData(data) {
|
||||||
function extractMultiSwipes(data, type) {
|
function extractMultiSwipes(data, type) {
|
||||||
const swipes = [];
|
const swipes = [];
|
||||||
|
|
||||||
if (type === 'continue' || type === 'impersonate') {
|
if (type === 'continue' || type === 'impersonate' || type === 'quiet') {
|
||||||
return swipes;
|
return swipes;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -409,7 +409,8 @@ function getBadWordPermutations(text) {
|
||||||
return result.filter(onlyUnique);
|
return result.filter(onlyUnique);
|
||||||
}
|
}
|
||||||
|
|
||||||
export function getNovelGenerationData(finalPrompt, settings, maxLength, isImpersonate, isContinue, cfgValues) {
|
export function getNovelGenerationData(finalPrompt, settings, maxLength, isImpersonate, isContinue, cfgValues, type) {
|
||||||
|
console.debug('NovelAI generation data for', type);
|
||||||
if (cfgValues && cfgValues.guidanceScale && cfgValues.guidanceScale?.value !== 1) {
|
if (cfgValues && cfgValues.guidanceScale && cfgValues.guidanceScale?.value !== 1) {
|
||||||
cfgValues.negativePrompt = (getCfgPrompt(cfgValues.guidanceScale, true))?.value;
|
cfgValues.negativePrompt = (getCfgPrompt(cfgValues.guidanceScale, true))?.value;
|
||||||
}
|
}
|
||||||
|
|
|
@ -586,8 +586,8 @@ function getModel() {
|
||||||
return undefined;
|
return undefined;
|
||||||
}
|
}
|
||||||
|
|
||||||
export function getTextGenGenerationData(finalPrompt, maxTokens, isImpersonate, isContinue, cfgValues) {
|
export function getTextGenGenerationData(finalPrompt, maxTokens, isImpersonate, isContinue, cfgValues, type) {
|
||||||
const canMultiSwipe = !isContinue && !isImpersonate;
|
const canMultiSwipe = !isContinue && !isImpersonate && type !== 'quiet';
|
||||||
let APIflags = {
|
let APIflags = {
|
||||||
'prompt': finalPrompt,
|
'prompt': finalPrompt,
|
||||||
'model': getModel(),
|
'model': getModel(),
|
||||||
|
|
Loading…
Reference in New Issue