mirror of
https://github.com/nomic-ai/gpt4all.git
synced 2025-06-22 13:41:08 +00:00
Restore the model when switching chats.
This commit is contained in:
parent
0bb52fc5fe
commit
081d32bd97
3
chat.cpp
3
chat.cpp
@ -127,13 +127,14 @@ bool Chat::isRecalc() const
|
|||||||
|
|
||||||
void Chat::unload()
|
void Chat::unload()
|
||||||
{
|
{
|
||||||
|
m_savedModelName = m_llmodel->modelName();
|
||||||
stopGenerating();
|
stopGenerating();
|
||||||
emit unloadRequested();
|
emit unloadRequested();
|
||||||
}
|
}
|
||||||
|
|
||||||
void Chat::reload()
|
void Chat::reload()
|
||||||
{
|
{
|
||||||
emit reloadRequested();
|
emit reloadRequested(m_savedModelName);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Chat::generatedNameChanged()
|
void Chat::generatedNameChanged()
|
||||||
|
3
chat.h
3
chat.h
@ -72,7 +72,7 @@ Q_SIGNALS:
|
|||||||
void setThreadCountRequested(int32_t threadCount);
|
void setThreadCountRequested(int32_t threadCount);
|
||||||
void recalcChanged();
|
void recalcChanged();
|
||||||
void unloadRequested();
|
void unloadRequested();
|
||||||
void reloadRequested();
|
void reloadRequested(const QString &modelName);
|
||||||
void generateNameRequested();
|
void generateNameRequested();
|
||||||
|
|
||||||
private Q_SLOTS:
|
private Q_SLOTS:
|
||||||
@ -86,6 +86,7 @@ private:
|
|||||||
QString m_id;
|
QString m_id;
|
||||||
QString m_name;
|
QString m_name;
|
||||||
QString m_userName;
|
QString m_userName;
|
||||||
|
QString m_savedModelName;
|
||||||
ChatModel *m_chatModel;
|
ChatModel *m_chatModel;
|
||||||
bool m_responseInProgress;
|
bool m_responseInProgress;
|
||||||
int32_t m_desiredThreadCount;
|
int32_t m_desiredThreadCount;
|
||||||
|
@ -295,9 +295,12 @@ void ChatLLM::unload()
|
|||||||
emit isModelLoadedChanged();
|
emit isModelLoadedChanged();
|
||||||
}
|
}
|
||||||
|
|
||||||
void ChatLLM::reload()
|
void ChatLLM::reload(const QString &modelName)
|
||||||
{
|
{
|
||||||
loadModel();
|
if (modelName.isEmpty())
|
||||||
|
loadModel();
|
||||||
|
else
|
||||||
|
loadModelPrivate(modelName);
|
||||||
}
|
}
|
||||||
|
|
||||||
void ChatLLM::generateName()
|
void ChatLLM::generateName()
|
||||||
|
@ -43,7 +43,7 @@ public Q_SLOTS:
|
|||||||
bool loadModel();
|
bool loadModel();
|
||||||
void modelNameChangeRequested(const QString &modelName);
|
void modelNameChangeRequested(const QString &modelName);
|
||||||
void unload();
|
void unload();
|
||||||
void reload();
|
void reload(const QString &modelName);
|
||||||
void generateName();
|
void generateName();
|
||||||
|
|
||||||
Q_SIGNALS:
|
Q_SIGNALS:
|
||||||
|
Loading…
Reference in New Issue
Block a user