Skip to content

Commit 1f3156d

Browse files
authored
fix: Check for existence of clip model path (#1264)
1 parent 2811014 commit 1f3156d

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

llama_cpp/llama_chat_format.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1848,6 +1848,9 @@ def __init__(self, clip_model_path: str, verbose: bool = False):
18481848
self.verbose = verbose
18491849
self._clip_free = self._llava_cpp._libllava.clip_free # type: ignore
18501850

1851+
if not os.path.exists(clip_model_path):
1852+
raise ValueError(f"Clip model path does not exist: {clip_model_path}")
1853+
18511854
with suppress_stdout_stderr(disable=self.verbose):
18521855
self.clip_ctx = self._llava_cpp.clip_model_load(
18531856
self.clip_model_path.encode(), 0

0 commit comments

Comments
 (0)