summaryrefslogtreecommitdiffstats
path: root/lualib/rspamadm/rescore.lua
diff options
context:
space:
mode:
Diffstat (limited to 'lualib/rspamadm/rescore.lua')
-rw-r--r--lualib/rspamadm/rescore.lua8
1 files changed, 6 insertions, 2 deletions
diff --git a/lualib/rspamadm/rescore.lua b/lualib/rspamadm/rescore.lua
index cc331c6e8..dfa73f2d5 100644
--- a/lualib/rspamadm/rescore.lua
+++ b/lualib/rspamadm/rescore.lua
@@ -18,8 +18,6 @@ if not rspamd_config:has_torch() then
return
end
-local torch = require "torch"
-local nn = require "nn"
local lua_util = require "lua_util"
local ucl = require "ucl"
local logger = require "rspamd_logger"
@@ -28,6 +26,10 @@ local rspamd_util = require "rspamd_util"
local argparse = require "argparse"
local rescore_utility = require "rescore_utility"
+-- Load these lazily
+local torch
+local nn
+
local opts
local ignore_symbols = {
['DATE_IN_PAST'] =true,
@@ -509,6 +511,8 @@ local function get_threshold()
end
local function handler(args)
+ torch = require "torch"
+ nn = require "nn"
opts = parser:parse(args)
if not opts['log'] then
parser:error('no log specified')