mirror of
https://github.com/nomic-ai/gpt4all.git
synced 2025-09-05 18:40:50 +00:00
Consolidate generation and application settings on the new settings object.
This commit is contained in:
@@ -1,6 +1,5 @@
|
||||
#include "llm.h"
|
||||
#include "../gpt4all-backend/sysinfo.h"
|
||||
#include "config.h"
|
||||
#include "chatlistmodel.h"
|
||||
#include "../gpt4all-backend/llmodel.h"
|
||||
#include "network.h"
|
||||
@@ -22,8 +21,6 @@ LLM *LLM::globalInstance()
|
||||
|
||||
LLM::LLM()
|
||||
: QObject{nullptr}
|
||||
, m_threadCount(std::min(4, (int32_t) std::thread::hardware_concurrency()))
|
||||
, m_serverEnabled(false)
|
||||
, m_compatHardware(true)
|
||||
{
|
||||
QString llmodelSearchPaths = QCoreApplication::applicationDirPath();
|
||||
@@ -39,8 +36,6 @@ LLM::LLM()
|
||||
llmodelSearchPaths += ";" + frameworksDir;
|
||||
#endif
|
||||
LLModel::setImplementationsSearchPath(llmodelSearchPaths.toStdString());
|
||||
connect(this, &LLM::serverEnabledChanged,
|
||||
ChatListModel::globalInstance(), &ChatListModel::handleServerEnabledChanged);
|
||||
|
||||
#if defined(__x86_64__)
|
||||
#ifndef _MSC_VER
|
||||
@@ -105,29 +100,3 @@ QString LLM::systemTotalRAMInGBString() const
|
||||
{
|
||||
return QString::fromStdString(getSystemTotalRAMInGBString());
|
||||
}
|
||||
|
||||
int32_t LLM::threadCount() const
|
||||
{
|
||||
return m_threadCount;
|
||||
}
|
||||
|
||||
void LLM::setThreadCount(int32_t n_threads)
|
||||
{
|
||||
if (n_threads <= 0)
|
||||
n_threads = std::min(4, (int32_t) std::thread::hardware_concurrency());
|
||||
m_threadCount = n_threads;
|
||||
emit threadCountChanged();
|
||||
}
|
||||
|
||||
bool LLM::serverEnabled() const
|
||||
{
|
||||
return m_serverEnabled;
|
||||
}
|
||||
|
||||
void LLM::setServerEnabled(bool enabled)
|
||||
{
|
||||
if (m_serverEnabled == enabled)
|
||||
return;
|
||||
m_serverEnabled = enabled;
|
||||
emit serverEnabledChanged();
|
||||
}
|
||||
|
Reference in New Issue
Block a user