From 79755c2edf54b99a3128d9616264ce58092ef302 Mon Sep 17 00:00:00 2001 From: maver Date: Thu, 11 Jan 2024 19:51:15 +0100 Subject: [PATCH 1/2] Add horizontal lining to bad words for NAI --- src/endpoints/novelai.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/endpoints/novelai.js b/src/endpoints/novelai.js index c26fa6f15..32ca7c84e 100644 --- a/src/endpoints/novelai.js +++ b/src/endpoints/novelai.js @@ -10,7 +10,7 @@ const API_NOVELAI = 'https://api.novelai.net'; // Ban bracket generation, plus defaults const badWordsList = [ [3], [49356], [1431], [31715], [34387], [20765], [30702], [10691], [49333], [1266], - [19438], [43145], [26523], [41471], [2936], [85, 85], [49332], [7286], [1115], + [19438], [43145], [26523], [41471], [2936], [85, 85], [49332], [7286], [1115], [24], ]; const hypeBotBadWordsList = [ From a86d3104d64e8760f7f1ee620ed0725fdbeb4fad Mon Sep 17 00:00:00 2001 From: maver Date: Thu, 11 Jan 2024 20:14:32 +0100 Subject: [PATCH 2/2] Add text adventure stop token to NAI --- src/endpoints/novelai.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/endpoints/novelai.js b/src/endpoints/novelai.js index 32ca7c84e..29a2f99a9 100644 --- a/src/endpoints/novelai.js +++ b/src/endpoints/novelai.js @@ -175,6 +175,13 @@ router.post('/generate', jsonParser, async function (req, res) { }, }; + // Tells the model to stop generation at '>' + if ('theme_textadventure' === req.body.prefix && + (true === req.body.model.includes('clio') || + true === req.body.model.includes('kayra'))) { + data.parameters.eos_token_id = 49405; + } + console.log(util.inspect(data, { depth: 4 })); const args = {