Fix lightgbm binding keyword argument issue (#251)

This commit is contained in:
noklam 2020-11-24 19:27:33 +08:00 committed by GitHub
parent a3ad6a0e50
commit 6064080232
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -118,11 +118,12 @@ class PatchLIGHTgbmModelIO(PatchBaseModelIO):
except Exception:
pass
return callback
params, train_set = args
kwargs.setdefault("callbacks", []).append(trains_lightgbm_callback())
ret = original_fn(params, train_set, **kwargs)
ret = original_fn(*args, **kwargs)
if not PatchLIGHTgbmModelIO.__main_task:
return ret
params = args[0] if args else kwargs['params']
for k, v in params.items():
if isinstance(v, set):
params[k] = list(v)