mirror of
https://github.com/nomic-ai/gpt4all.git
synced 2025-06-21 21:19: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()
|
||||
{
|
||||
m_savedModelName = m_llmodel->modelName();
|
||||
stopGenerating();
|
||||
emit unloadRequested();
|
||||
}
|
||||
|
||||
void Chat::reload()
|
||||
{
|
||||
emit reloadRequested();
|
||||
emit reloadRequested(m_savedModelName);
|
||||
}
|
||||
|
||||
void Chat::generatedNameChanged()
|
||||
|
3
chat.h
3
chat.h
@ -72,7 +72,7 @@ Q_SIGNALS:
|
||||
void setThreadCountRequested(int32_t threadCount);
|
||||
void recalcChanged();
|
||||
void unloadRequested();
|
||||
void reloadRequested();
|
||||
void reloadRequested(const QString &modelName);
|
||||
void generateNameRequested();
|
||||
|
||||
private Q_SLOTS:
|
||||
@ -86,6 +86,7 @@ private:
|
||||
QString m_id;
|
||||
QString m_name;
|
||||
QString m_userName;
|
||||
QString m_savedModelName;
|
||||
ChatModel *m_chatModel;
|
||||
bool m_responseInProgress;
|
||||
int32_t m_desiredThreadCount;
|
||||
|
@ -295,9 +295,12 @@ void ChatLLM::unload()
|
||||
emit isModelLoadedChanged();
|
||||
}
|
||||
|
||||
void ChatLLM::reload()
|
||||
void ChatLLM::reload(const QString &modelName)
|
||||
{
|
||||
loadModel();
|
||||
if (modelName.isEmpty())
|
||||
loadModel();
|
||||
else
|
||||
loadModelPrivate(modelName);
|
||||
}
|
||||
|
||||
void ChatLLM::generateName()
|
||||
|
Loading…
Reference in New Issue
Block a user