Skip to content

Commit

Permalink
fix: Check for existence of clip model path (abetlen#1264)
Browse files Browse the repository at this point in the history
  • Loading branch information
kejcao authored Mar 9, 2024
1 parent 2811014 commit 1f3156d
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions llama_cpp/llama_chat_format.py
Original file line number Diff line number Diff line change
Expand Up @@ -1848,6 +1848,9 @@ def __init__(self, clip_model_path: str, verbose: bool = False):
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
Expand Down

0 comments on commit 1f3156d

Please sign in to comment.