From 5d76e78c2ff0bb8769885a91105aef077fb2b4cc Mon Sep 17 00:00:00 2001 From: Josh Yan Date: Mon, 1 Jul 2024 15:43:03 -0700 Subject: [PATCH] add error message for unsupported arch --- build.log | 0 llm/status.go | 13 +++++++++++++ 2 files changed, 13 insertions(+) create mode 100644 build.log diff --git a/build.log b/build.log new file mode 100644 index 000000000..e69de29bb diff --git a/llm/status.go b/llm/status.go index 8a49bd55a..7fc76621c 100644 --- a/llm/status.go +++ b/llm/status.go @@ -34,6 +34,19 @@ func (w *StatusWriter) Write(b []byte) (int, error) { errMsg = prefix + string(bytes.TrimSpace(after)) } } + + if bytes.Contains(b, []byte("unknown model architecture")) { + if _, after, ok := bytes.Cut(b, []byte("architecture")); ok { + errMsg = "error" + string(bytes.TrimSpace(after)) + + if before, _, ok := bytes.Cut(after, []byte("llama_load")); ok { + errMsg = "error" + string(bytes.TrimSpace(before)) + } + + errMsg = errMsg + "\nYour current version of Ollama doesn't support this model architecture. Consider upgrading." + } + } + if errMsg != "" { w.LastErrMsg = errMsg }