Cleanup the chatllm properly.

This commit is contained in:
Adam Treat
2023-05-12 14:06:03 -04:00
committed by AT
parent 57ba554478
commit 76675536b0
4 changed files with 21 additions and 0 deletions

View File

@@ -11,6 +11,17 @@ Chat::Chat(QObject *parent)
, m_responseInProgress(false)
, m_creationDate(QDateTime::currentSecsSinceEpoch())
, m_llmodel(new ChatLLM(this))
{
connectLLM();
}
Chat::~Chat()
{
delete m_llmodel;
m_llmodel = nullptr;
}
void Chat::connectLLM()
{
// Should be in same thread
connect(Download::globalInstance(), &Download::modelListChanged, this, &Chat::modelListChanged, Qt::DirectConnection);