KoboldAI-Client/cores/default.lua
Gnome Ann 341b153360 Lua API fixes
* `print()` and `warn()` now work correctly with `nil` arguments
* Typo: `gpt-neo-1.3M` has been corrected to `gpt-neo-1.3B`
* Regeneration is no longer triggered when writing to `keysecondary` of
  a non-selective key
* Handle `genamt` changes in generation modifier properly
* Writing to `kobold.settings.numseqs` from a generation modifier no
  longer affects
* Formatting options in `kobold.settings` have been fixed
* Added aliases for setting names
* Fix behaviour of editing story chunks from a generation modifier
* Warnings are now yellow instead of red
* kobold.logits is now the raw logits prior to being filtered, like
  the documentation says, rather than after being filtered
* Some erroneous comments and error messages have been corrected
* These parts of the API have now been implemented properly:
    * `compute_context()` methods
    * `kobold.authorsnote`
    * `kobold.restart_generation()`
2021-12-19 20:18:28 -05:00

35 lines
909 B
Lua

-- Default core script
-- Runs all generation modifiers and output modifiers in forward order, and
-- runs all input modifiers in reverse order
kobold, koboldcore = require("bridge")() -- This line is optional and is only for EmmyLua type annotations
---@class KoboldCoreScript
local corescript = {}
-- Run all the input modifiers from bottom to top
function corescript.inmod()
for i = #koboldcore.userscripts, 1, -1 do
local userscript = koboldcore.userscripts[i]
userscript.inmod()
end
end
-- Run all the generation modifiers from top to bottom
function corescript.genmod()
for i, userscript in ipairs(koboldcore.userscripts) do
userscript.genmod()
end
end
-- Run all the generation modifiers from top to bottom
function corescript.outmod()
for i, userscript in ipairs(koboldcore.userscripts) do
userscript.outmod()
end
end
return corescript