From 795715fb594b0217f9655d27e5fb2b82b070f5ba 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(); }