Fix state issues with reloading model.

Signed-off-by: Adam Treat <treat.adam@gmail.com>
This commit is contained in:
Adam Treat 2024-02-21 16:05:49 -05:00
parent 4fc4d94be4
commit 67bbce43ab
2 changed files with 6 additions and 2 deletions

View File

@ -672,7 +672,11 @@ void ChatLLM::unloadModel()
if (!isModelLoaded() || m_isServer)
return;
emit modelLoadingPercentageChanged(0.0f);
if (!m_forceUnloadModel || !m_shouldBeLoaded)
emit modelLoadingPercentageChanged(0.0f);
else
emit modelLoadingPercentageChanged(std::numeric_limits<float>::min()); // small non-zero positive value
saveState();
#if defined(DEBUG_MODEL_LOADING)
qDebug() << "unloadModel" << m_llmThread.objectName() << m_llModelInfo.model;

View File

@ -463,7 +463,7 @@ Window {
MyMiniButton {
id: ejectButton
visible: currentChat.isModelLoaded
visible: currentChat.isModelLoaded && !window.isCurrentlyLoading
z: 500
anchors.right: parent.right
anchors.rightMargin: 50