Skip to content

Commit

Permalink
Merge pull request rapidsai#5203 from rapidsai/branch-23.02
Browse files Browse the repository at this point in the history
Forward-merge branch-23.02 to branch-23.04
  • Loading branch information
GPUtester authored Feb 5, 2023
2 parents 25fd377 + a1c22e4 commit 8dbc3e5
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions python/cuml/fil/fil.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -116,13 +116,13 @@ cdef class TreeliteModel():
TreeliteQueryNumFeature(self.handle, &out)
return out

@staticmethod
def free_treelite_model(model_handle):
@classmethod
def free_treelite_model(cls, model_handle):
cdef uintptr_t model_ptr = <uintptr_t>model_handle
TreeliteFreeModel(<ModelHandle> model_ptr)

@staticmethod
def from_filename(filename, model_type="xgboost"):
@classmethod
def from_filename(cls, filename, model_type="xgboost"):
"""
Returns a TreeliteModel object loaded from `filename`
Expand Down Expand Up @@ -173,8 +173,9 @@ cdef class TreeliteModel():
filename_bytes = filename.encode("UTF-8")
TreeliteSerializeModel(filename_bytes, self.handle)

@staticmethod
def from_treelite_model_handle(treelite_handle,
@classmethod
def from_treelite_model_handle(cls,
treelite_handle,
take_handle_ownership=False):
cdef ModelHandle handle = <ModelHandle> <size_t> treelite_handle
model = TreeliteModel(owns_handle=take_handle_ownership)
Expand Down Expand Up @@ -843,8 +844,9 @@ class ForestInference(Base,
)
return cuml_fm

@staticmethod
def load(filename,
@classmethod
def load(cls,
filename,
output_class=False,
threshold=0.50,
algo='auto',
Expand Down

0 comments on commit 8dbc3e5

Please sign in to comment.