mirror of
https://github.com/KoboldAI/KoboldAI-Client.git
synced 2024-12-26 08:13:13 +01:00
Fix a bug that occurs when userscript doesn't have all 3 modifiers
This commit is contained in:
parent
34c52a1a23
commit
ed9c2a4d52
@ -1584,9 +1584,9 @@ return function(_python, _bridged)
|
||||
local _userscript = old_loadfile(join_folder_and_filename(bridged.userscript_path, filename), "t", koboldbridge.get_universe(filename))()
|
||||
koboldbridge.logging_name = nil
|
||||
local userscript = deepcopy(KoboldUserScriptModule)
|
||||
rawset(userscript, "_inmod", function() koboldbridge.logging_name = modulenames[i]; _userscript.inmod() end)
|
||||
rawset(userscript, "_genmod", function() koboldbridge.logging_name = modulenames[i]; _userscript.genmod() end)
|
||||
rawset(userscript, "_outmod", function() koboldbridge.logging_name = modulenames[i]; _userscript.outmod() end)
|
||||
rawset(userscript, "_inmod", function() koboldbridge.logging_name = modulenames[i]; if _userscript.inmod ~= nil then _userscript.inmod() end end)
|
||||
rawset(userscript, "_genmod", function() koboldbridge.logging_name = modulenames[i]; if _userscript.genmod ~= nil then _userscript.genmod() end end)
|
||||
rawset(userscript, "_outmod", function() koboldbridge.logging_name = modulenames[i]; if _userscript.outmod ~= nil then _userscript.outmod() end end)
|
||||
rawset(userscript, "_filename", filename)
|
||||
rawset(userscript, "_modulename", modulenames[i])
|
||||
rawset(userscript, "_description", descriptions[i])
|
||||
|
@ -12,27 +12,21 @@ local corescript = {}
|
||||
function corescript.inmod()
|
||||
for i = #koboldcore.userscripts, 1, -1 do
|
||||
local userscript = koboldcore.userscripts[i]
|
||||
if userscript.inmod ~= nil then
|
||||
userscript.inmod()
|
||||
end
|
||||
userscript.inmod()
|
||||
end
|
||||
end
|
||||
|
||||
-- Run all the generation modifiers from top to bottom
|
||||
function corescript.genmod()
|
||||
for i, userscript in ipairs(koboldcore.userscripts) do
|
||||
if userscript.genmod ~= nil then
|
||||
userscript.genmod()
|
||||
end
|
||||
userscript.genmod()
|
||||
end
|
||||
end
|
||||
|
||||
-- Run all the generation modifiers from top to bottom
|
||||
function corescript.outmod()
|
||||
for i, userscript in ipairs(koboldcore.userscripts) do
|
||||
if userscript.outmod ~= nil then
|
||||
userscript.outmod()
|
||||
end
|
||||
userscript.outmod()
|
||||
end
|
||||
end
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user