From a906dee1a6fa53b8fd78fb72facc43ceb8835fe9 Mon Sep 17 00:00:00 2001 From: lxcxjxhx Date: Mon, 6 Jul 2026 13:07:30 +0800 Subject: [PATCH] fix: improve error message for invalid model path - Add helpful guidance when model path does not exist - Suggest verifying path correctness and GGUF file accessibility - Addresses issue #2145 (Improve error messages) --- llama_cpp/llama.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/llama_cpp/llama.py b/llama_cpp/llama.py index b5bffd46b..1c4232134 100644 --- a/llama_cpp/llama.py +++ b/llama_cpp/llama.py @@ -374,7 +374,10 @@ def __init__( self.spm_infill = spm_infill if not os.path.exists(model_path): - raise ValueError(f"Model path does not exist: {model_path}") + raise ValueError( + f"Model path does not exist: {model_path}. " + f"Please verify the path is correct and the GGUF model file is accessible." + ) self._model = self._stack.enter_context( contextlib.closing(