Skip to content

Commit

Permalink
fix handle
Browse files Browse the repository at this point in the history
Signed-off-by: Xavier Dupre <[email protected]>
  • Loading branch information
xadupre committed Jul 28, 2023
1 parent bfd93f1 commit cdcee13
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion onnxmltools/convert/lightgbm/operator_converters/LightGbm.py
Original file line number Diff line number Diff line change
Expand Up @@ -379,9 +379,13 @@ def dump_booster_model(
if actual_len > buffer_len:
string_buffer = ctypes.create_string_buffer(actual_len)
ptr_string_buffer = ctypes.c_char_p(*[ctypes.addressof(string_buffer)])
try:
handle = self._handle
except AttributeError:
handle = self.handle
_safe_call(
_LIB.LGBM_BoosterDumpModel(
self.handle,
handle,
ctypes.c_int(start_iteration),
ctypes.c_int(num_iteration),
ctypes.c_int(importance_type_int),
Expand Down

0 comments on commit cdcee13

Please sign in to comment.