From 27912f6e1a21daf68cf05b41841c2c06b8140571 Mon Sep 17 00:00:00 2001 From: Adam Treat Date: Mon, 22 Jan 2024 14:15:13 -0500 Subject: [PATCH] Fix bug with install of online models. --- gpt4all-chat/download.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/gpt4all-chat/download.cpp b/gpt4all-chat/download.cpp index 2a20fc28..e1a688a4 100644 --- a/gpt4all-chat/download.cpp +++ b/gpt4all-chat/download.cpp @@ -185,7 +185,10 @@ void Download::installModel(const QString &modelFile, const QString &apiKey) QTextStream stream(&file); stream << apiKey; file.close(); + ModelList::globalInstance()->updateModelsFromDirectory(); } + + ModelList::globalInstance()->updateDataByFilename(modelFile, ModelList::InstalledRole, true); } void Download::removeModel(const QString &modelFile) @@ -202,6 +205,7 @@ void Download::removeModel(const QString &modelFile) file.remove(); } + ModelList::globalInstance()->updateDataByFilename(modelFile, ModelList::InstalledRole, false); ModelList::globalInstance()->updateDataByFilename(modelFile, ModelList::BytesReceivedRole, 0); ModelList::globalInstance()->updateDataByFilename(modelFile, ModelList::BytesTotalRole, 0); ModelList::globalInstance()->updateDataByFilename(modelFile, ModelList::TimestampRole, 0);