Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix neural check in lua_cfg_transform.lua #4946

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

mykeenu
Copy link

@mykeenu mykeenu commented Apr 26, 2024

check for neural.enabled to see if it's enabled. only checking for neural is always true unless someone messed with config files.

@vstakhov
Copy link
Member

We might also check if there are any rules defined there

@mykeenu
Copy link
Author

mykeenu commented Apr 27, 2024

i have no clue why this makes some tests fail.

@vstakhov
Copy link
Member

Tests are failing because enabled can be missing of course, so the check must be changed to something like if cfg.neural and (type(cfg.neural.enabled) ~= 'boolean' or cfg.neural.enabled)

@@ -544,7 +544,7 @@ return function(cfg)
end

-- If neural network is enabled we MUST have `check_all_filters` flag
if cfg.neural then
if cfg.neural and cfg.neural.enabled then
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if cfg.neural and cfg.neural.enabled then
if cfg.neural and cfg.neural.enabled ~= false and next(cfg.neural.rules or {}) then

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants