From a86d3104d64e8760f7f1ee620ed0725fdbeb4fad Mon Sep 17 00:00:00 2001 From: maver Date: Thu, 11 Jan 2024 20:14:32 +0100 Subject: [PATCH] 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 = {