mirror of
https://github.com/nomic-ai/gpt4all.git
synced 2024-10-01 01:06:10 -04:00
Simplify.
This commit is contained in:
parent
53a39b9ecf
commit
9c008fb677
@ -76,14 +76,11 @@ bool ChatLLM::loadModel(const QString &modelName)
|
||||
if (isModelLoaded() && m_modelName == modelName)
|
||||
return true;
|
||||
|
||||
bool isFirstLoad = false;
|
||||
if (isModelLoaded()) {
|
||||
resetContextPrivate();
|
||||
delete m_llmodel;
|
||||
m_llmodel = nullptr;
|
||||
emit isModelLoadedChanged();
|
||||
} else {
|
||||
isFirstLoad = true;
|
||||
}
|
||||
|
||||
bool isGPTJ = false;
|
||||
@ -122,9 +119,11 @@ bool ChatLLM::loadModel(const QString &modelName)
|
||||
|
||||
emit isModelLoadedChanged();
|
||||
|
||||
if (isFirstLoad)
|
||||
static bool isFirstLoad = false;
|
||||
if (isFirstLoad) {
|
||||
emit sendStartup();
|
||||
else
|
||||
isFirstLoad = false;
|
||||
} else
|
||||
emit sendModelLoaded();
|
||||
} else {
|
||||
const QString error = QString("Could not find model %1").arg(modelName);
|
||||
|
Loading…
Reference in New Issue
Block a user