diff options
author | Andrew Lewis <nerf@judo.za.org> | 2020-12-17 11:28:09 +0200 |
---|---|---|
committer | Andrew Lewis <nerf@judo.za.org> | 2020-12-17 11:28:09 +0200 |
commit | 960b608d352e8c820b0725d898d78959ca59ee7d (patch) | |
tree | 9d9f192e1c3161a804e94e1aed1c0a63b77929c0 /test/functional/util | |
parent | 5ce6a2d97ff655651e4bba7737b834d866b94c94 (diff) | |
download | rspamd-960b608d352e8c820b0725d898d78959ca59ee7d.tar.gz rspamd-960b608d352e8c820b0725d898d78959ca59ee7d.zip |
[Feature] Add controller endpoint for training neural
- Move neural functions to library
- Parameterise spawn_train
- neural plugin: Fix store_pool_only when autotrain is true
- neural plugin: Use cache_set instead of mempool
- Add test
Diffstat (limited to 'test/functional/util')
-rw-r--r-- | test/functional/util/nn_unpack.lua | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/test/functional/util/nn_unpack.lua b/test/functional/util/nn_unpack.lua new file mode 100644 index 000000000..fee98d5a0 --- /dev/null +++ b/test/functional/util/nn_unpack.lua @@ -0,0 +1,16 @@ +local ucl = require "ucl" + +local function unhex(str) + return (str:gsub('..', function (cc) + return string.char(tonumber(cc, 16)) + end)) +end + +local parser = ucl.parser() +local ok, err = parser:parse_string(unhex(arg[1]), 'msgpack') +if not ok then + io.stderr:write(err) + os.exit(1) +end + +print(ucl.to_format(parser:get_object(), 'json-compact')) |