chatllm: fix model loading progress showing "Reload" sometimes (#2337)

Signed-off-by: Jared Van Bortel <jared@nomic.ai>
This commit is contained in:
Jared Van Bortel 2024-05-15 13:57:53 -04:00 committed by GitHub
parent 9f9d8e636f
commit 7f1c3d4275
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -350,6 +350,7 @@ bool ChatLLM::loadModel(const ModelInfo &modelInfo)
} }
m_llModelInfo.model->setProgressCallback([this](float progress) -> bool { m_llModelInfo.model->setProgressCallback([this](float progress) -> bool {
progress = std::max(progress, std::numeric_limits<float>::min()); // keep progress above zero
emit modelLoadingPercentageChanged(progress); emit modelLoadingPercentageChanged(progress);
return m_shouldBeLoaded; return m_shouldBeLoaded;
}); });