8000
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 3632241 commit dd22010Copy full SHA for dd22010
llama_cpp/_internals.py
@@ -51,6 +51,9 @@ def __init__(
51
self.path_model.encode("utf-8"), self.params
52
)
53
54
+ if self.model is None:
55
+ raise ValueError(f"Failed to load model from file: {path_model}")
56
+
57
def __del__(self):
58
if self.model is not None and self._llama_free_model is not None:
59
self._llama_free_model(self.model)
@@ -258,6 +261,9 @@ def __init__(
258
261
self.model.model, self.params
259
262
260
263
264
+ if self.ctx is None:
265
+ raise ValueError("Failed to create llama_context")
266
267
268
if self.ctx is not None and self._llama_free is not None:
269
self._llama_free(self.ctx)
0 commit comments