From 1f3156d4f2d8c5439dbb2ad72b8c1de84703eb09 Mon Sep 17 00:00:00 2001 From: Kevin Cao Date: Fri, 8 Mar 2024 21:00:10 -0500 Subject: [PATCH] fix: Check for existence of clip model path (#1264) --- llama_cpp/llama_chat_format.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/llama_cpp/llama_chat_format.py b/llama_cpp/llama_chat_format.py index 69ed601..4eb2b02 100644 --- a/llama_cpp/llama_chat_format.py +++ b/llama_cpp/llama_chat_format.py @@ -1848,6 +1848,9 @@ class Llava15ChatHandler: self.verbose = verbose self._clip_free = self._llava_cpp._libllava.clip_free # type: ignore + if not os.path.exists(clip_model_path): + raise ValueError(f"Clip model path does not exist: {clip_model_path}") + with suppress_stdout_stderr(disable=self.verbose): self.clip_ctx = self._llava_cpp.clip_model_load( self.clip_model_path.encode(), 0