mirror of
https://github.com/nomic-ai/gpt4all.git
synced 2025-10-27 19:43:11 +00:00
Much better memory mgmt for multi-threaded model loading/unloading.
This commit is contained in:
@@ -40,6 +40,7 @@ void ChatListModel::setShouldSaveChats(bool b)
|
||||
|
||||
void ChatListModel::removeChatFile(Chat *chat) const
|
||||
{
|
||||
Q_ASSERT(chat != m_serverChat);
|
||||
const QString savePath = Download::globalInstance()->downloadLocalModelsPath();
|
||||
QFile file(savePath + "/gpt4all-" + chat->id() + ".chat");
|
||||
if (!file.exists())
|
||||
@@ -58,6 +59,8 @@ void ChatListModel::saveChats() const
|
||||
timer.start();
|
||||
const QString savePath = Download::globalInstance()->downloadLocalModelsPath();
|
||||
for (Chat *chat : m_chats) {
|
||||
if (chat == m_serverChat)
|
||||
continue;
|
||||
QString fileName = "gpt4all-" + chat->id() + ".chat";
|
||||
QFile file(savePath + "/" + fileName);
|
||||
bool success = file.open(QIODevice::WriteOnly);
|
||||
|
||||
Reference in New Issue
Block a user