Fix rep penalty parameter name

This commit is contained in:
Mike Weldon 2023-07-30 14:14:17 -07:00
parent 27c6e5ecff
commit 73ea029acd
2 changed files with 5 additions and 5 deletions

View File

@ -1799,7 +1799,7 @@ app.post("/generate_novelai", jsonParser, async function (request, response_gene
controller.abort();
});
const bw = require('./src/novelai');
const novelai = require('./src/novelai');
const isNewModel = (request.body.model.includes('clio') || request.body.model.includes('kayra'));
const isKrake = request.body.model.includes('krake');
const data = {
@ -1816,6 +1816,7 @@ app.post("/generate_novelai", jsonParser, async function (request, response_gene
"repetition_penalty_slope": request.body.repetition_penalty_slope,
"repetition_penalty_frequency": request.body.repetition_penalty_frequency,
"repetition_penalty_presence": request.body.repetition_penalty_presence,
"repetition_penalty_whitelist": isNewModel ? novelai.repPenaltyAllowList : null,
"top_a": request.body.top_a,
"top_p": request.body.top_p,
"top_k": request.body.top_k,
@ -1824,9 +1825,8 @@ app.post("/generate_novelai", jsonParser, async function (request, response_gene
"cfg_uc": request.body.cfg_uc,
"phrase_rep_pen": request.body.phrase_rep_pen,
//"stop_sequences": {{187}},
"bad_words_ids": isNewModel ? bw.badWordsList : (isKrake ? bw.krakeBadWordsList : bw.euterpeBadWordsList),
"logit_bias_exp": isNewModel ? bw.logitBiasExp : null,
"reputation_penalty_whitelist": isNewModel ? bw.repPenaltyAllowList : null,
"bad_words_ids": isNewModel ? novelai.badWordsList : (isKrake ? novelai.krakeBadWordsList : novelai.euterpeBadWordsList),
"logit_bias_exp": isNewModel ? novelai.logitBiasExp : null,
//generate_until_sentence = true;
"use_cache": request.body.use_cache,
"use_string": true,

View File

@ -52,7 +52,7 @@ const badWordsList = [
[20765], [30702], [10691], [49333], [1266], [26523], [41471], [2936], [85, 85], [49332], [7286], [1115]
]
// Used for phrase reputation penalty
// Used for phrase repetition penalty
const repPenaltyAllowList = [
[49256, 49264, 49231, 49230, 49287, 85, 49255, 49399, 49262, 336, 333, 432, 363, 468, 492, 745, 401, 426, 623, 794,
1096, 2919, 2072, 7379, 1259, 2110, 620, 526, 487, 16562, 603, 805, 761, 2681, 942, 8917, 653, 3513, 506, 5301,