From 43e6d05d2172c17d5e5e83c3f2911a99f18f42b2 Mon Sep 17 00:00:00 2001 From: Adam Treat Date: Thu, 20 Apr 2023 07:17:07 -0400 Subject: [PATCH] Don't crash starting with no model. --- llm.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/llm.cpp b/llm.cpp index 9c175785..69e486d0 100644 --- a/llm.cpp +++ b/llm.cpp @@ -89,6 +89,8 @@ void LLMObject::setThreadCount(int32_t n_threads) { } int32_t LLMObject::threadCount() { + if (!m_llmodel) + return 1; return m_llmodel->threadCount(); }