From 46986d5f26f6a57759a8705b39915b68310f3c81 Mon Sep 17 00:00:00 2001 From: Richard Guo Date: Fri, 2 Jun 2023 11:13:26 -0400 Subject: [PATCH] cleanup --- gpt4all-bindings/python/gpt4all/pyllmodel.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/gpt4all-bindings/python/gpt4all/pyllmodel.py b/gpt4all-bindings/python/gpt4all/pyllmodel.py index 799a0153..39911fb3 100644 --- a/gpt4all-bindings/python/gpt4all/pyllmodel.py +++ b/gpt4all-bindings/python/gpt4all/pyllmodel.py @@ -75,6 +75,9 @@ llmodel.llmodel_model_create.restype = ctypes.c_void_p llmodel.llmodel_model_create2.argtypes = [ctypes.c_char_p, ctypes.c_char_p, ctypes.POINTER(LLModelError)] llmodel.llmodel_model_create2.restype = ctypes.c_void_p +llmodel.llmodel_model_destroy.argtypes = [ctypes.c_void_p] +llmodel.llmodel_model_destroy.restype = None + llmodel.llmodel_loadModel.argtypes = [ctypes.c_void_p, ctypes.c_char_p] llmodel.llmodel_loadModel.restype = ctypes.c_bool llmodel.llmodel_isModelLoaded.argtypes = [ctypes.c_void_p] @@ -124,7 +127,7 @@ class LLModel: self.model_name = None def __del__(self): - if self.model is not None and llmodel is not None: + if self.model is not None: llmodel.llmodel_model_destroy(self.model) def load_model(self, model_path: str) -> bool: