From 7f1c3d42755ca279d7d0377fecaff0c2fd93b068 Mon Sep 17 00:00:00 2001 From: Jared Van Bortel Date: Wed, 15 May 2024 13:57:53 -0400 Subject: [PATCH] chatllm: fix model loading progress showing "Reload" sometimes (#2337) Signed-off-by: Jared Van Bortel --- gpt4all-chat/chatllm.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/gpt4all-chat/chatllm.cpp b/gpt4all-chat/chatllm.cpp index 89505ef7..e54301c8 100644 --- a/gpt4all-chat/chatllm.cpp +++ b/gpt4all-chat/chatllm.cpp @@ -350,6 +350,7 @@ bool ChatLLM::loadModel(const ModelInfo &modelInfo) } m_llModelInfo.model->setProgressCallback([this](float progress) -> bool { + progress = std::max(progress, std::numeric_limits::min()); // keep progress above zero emit modelLoadingPercentageChanged(progress); return m_shouldBeLoaded; });