diff --git a/chatllm.cpp b/chatllm.cpp index 071a7ddb..89917278 100644 --- a/chatllm.cpp +++ b/chatllm.cpp @@ -404,7 +404,7 @@ void ChatLLM::saveState() void ChatLLM::restoreState() { - if (!isModelLoaded()) + if (!isModelLoaded() || m_state.isEmpty()) return; m_llmodel->restoreState(static_cast(reinterpret_cast(m_state.data())));