add error message for unsupported arch

This commit is contained in:
Josh Yan 2024-07-01 15:43:03 -07:00
parent cb42e607c5
commit 5d76e78c2f
2 changed files with 13 additions and 0 deletions

0
build.log Normal file
View File

View File

@ -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
}