mirror of
https://github.com/SillyTavern/SillyTavern.git
synced 2025-06-05 21:59:27 +02:00
CFG: NAI fixes
NAI does CFG differently, so add special cases for them. Also gate CFG access to only work on textgenwebui since that's where it's implemented. Signed-off-by: kingbri <bdashore3@proton.me>
This commit is contained in:
@@ -2971,7 +2971,7 @@ async function Generate(type, { automatic_trigger, force_name2, resolve, reject,
|
||||
}
|
||||
|
||||
// Get the negative prompt first since it has the unmodified mesSend array
|
||||
let negativePrompt = getCombinedPrompt(true);
|
||||
let negativePrompt = main_api == 'textgenerationwebui' ? getCombinedPrompt(true) : undefined;
|
||||
let finalPromt = getCombinedPrompt(false);
|
||||
const cfgValues = {
|
||||
guidanceScale: cfgGuidanceScale?.value,
|
||||
|
@@ -7,6 +7,7 @@ import {
|
||||
saveSettingsDebounced,
|
||||
setGenerationParamsFromPreset
|
||||
} from "../script.js";
|
||||
import { getCfgPrompt } from "./extensions/cfg/util.js";
|
||||
import { MAX_CONTEXT_DEFAULT, tokenizers } from "./power-user.js";
|
||||
import {
|
||||
getSortableDelay,
|
||||
@@ -395,6 +396,10 @@ function getBadWordPermutations(text) {
|
||||
}
|
||||
|
||||
export function getNovelGenerationData(finalPrompt, this_settings, this_amount_gen, isImpersonate, cfgValues) {
|
||||
if (cfgValues.guidanceScale && cfgValues.guidanceScale !== 1) {
|
||||
cfgValues.negativePrompt = (getCfgPrompt(cfgValues.guidanceScale, true))?.value;
|
||||
}
|
||||
|
||||
const clio = nai_settings.model_novel.includes('clio');
|
||||
const kayra = nai_settings.model_novel.includes('kayra');
|
||||
|
||||
|
Reference in New Issue
Block a user