mirror of
https://github.com/SillyTavern/SillyTavern.git
synced 2025-06-05 21:59:27 +02:00
CFG: Use ST prompt builder for negatives
Make the generate function build a negative prompt in addition to the normal one. This allows for nonconflicting insertion with other extension prompts and World Info. Signed-off-by: kingbri <bdashore3@proton.me>
This commit is contained in:
@@ -6,8 +6,6 @@ import {
|
||||
setGenerationParamsFromPreset,
|
||||
} from "../script.js";
|
||||
|
||||
import { getCfg } from "./extensions/cfg/util.js";
|
||||
|
||||
import {
|
||||
power_user,
|
||||
} from "./power-user.js";
|
||||
@@ -235,12 +233,7 @@ async function generateTextGenWithStreaming(generate_data, signal) {
|
||||
}
|
||||
}
|
||||
|
||||
export function getTextGenGenerationData(finalPromt, this_amount_gen, isImpersonate) {
|
||||
let cfgValues = {};
|
||||
if (!isImpersonate) {
|
||||
cfgValues = getCfg(finalPromt);
|
||||
}
|
||||
|
||||
export function getTextGenGenerationData(finalPromt, this_amount_gen, isImpersonate, cfgValues) {
|
||||
return {
|
||||
'prompt': finalPromt,
|
||||
'max_new_tokens': this_amount_gen,
|
||||
@@ -258,8 +251,8 @@ export function getTextGenGenerationData(finalPromt, this_amount_gen, isImperson
|
||||
'penalty_alpha': textgenerationwebui_settings.penalty_alpha,
|
||||
'length_penalty': textgenerationwebui_settings.length_penalty,
|
||||
'early_stopping': textgenerationwebui_settings.early_stopping,
|
||||
'guidance_scale': cfgValues?.guidanceScale ?? textgenerationwebui_settings.guidance_scale ?? 1,
|
||||
'negative_prompt': cfgValues?.negativePrompt ?? textgenerationwebui_settings.negative_prompt ?? '',
|
||||
'guidance_scale': isImpersonate ? 1 : cfgValues?.guidanceScale ?? textgenerationwebui_settings.guidance_scale ?? 1,
|
||||
'negative_prompt': isImpersonate ? '' : cfgValues?.negativePrompt ?? textgenerationwebui_settings.negative_prompt ?? '',
|
||||
'seed': textgenerationwebui_settings.seed,
|
||||
'add_bos_token': textgenerationwebui_settings.add_bos_token,
|
||||
'stopping_strings': getStoppingStrings(isImpersonate, false),
|
||||
|
Reference in New Issue
Block a user