fix: annoying bug where attribute exceptions were droining out file not found exceptions
This commit is contained in:
parent
ffa81218f6
commit
abc538fcd5
1 changed files with 2 additions and 2 deletions
|
@ -1503,10 +1503,10 @@ class Llama:
|
|||
return self._convert_text_completion_to_chat(completion)
|
||||
|
||||
def __del__(self):
|
||||
if self.model is not None:
|
||||
if hasattr(self, "model") and self.model is not None:
|
||||
llama_cpp.llama_free_model(self.model)
|
||||
self.model = None
|
||||
if self.ctx is not None:
|
||||
if hasattr(self, "ctx") and self.ctx is not None:
|
||||
llama_cpp.llama_free(self.ctx)
|
||||
self.ctx = None
|
||||
|
||||
|
|
Loading…
Reference in a new issue