mirror of
https://github.com/SillyTavern/SillyTavern.git
synced 2025-06-05 21:59:27 +02:00
Extensions: Add global CFG support
CFG is bundled as an extension which is more flexible in terms of storing settings and consolidating code. Global CFG is currently supported and the old power user setting is auto-migrated. Signed-off-by: kingbri <bdashore3@proton.me>
This commit is contained in:
@ -6,6 +6,8 @@ import {
|
||||
setGenerationParamsFromPreset,
|
||||
} from "../script.js";
|
||||
|
||||
import { getCfg } from "./extensions/cfg/util.js";
|
||||
|
||||
import {
|
||||
power_user,
|
||||
} from "./power-user.js";
|
||||
@ -230,6 +232,8 @@ async function generateTextGenWithStreaming(generate_data, signal) {
|
||||
}
|
||||
|
||||
export function getTextGenGenerationData(finalPromt, this_amount_gen, isImpersonate) {
|
||||
const { guidanceScale, negativePrompt } = getCfg();
|
||||
|
||||
return {
|
||||
'prompt': finalPromt,
|
||||
'max_new_tokens': this_amount_gen,
|
||||
@ -247,6 +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': guidanceScale ?? 1,
|
||||
'negative_prompt': negativePrompt ?? '',
|
||||
'seed': textgenerationwebui_settings.seed,
|
||||
'add_bos_token': textgenerationwebui_settings.add_bos_token,
|
||||
'stopping_strings': getStoppingStrings(isImpersonate, false),
|
||||
|
Reference in New Issue
Block a user