Use sysinfo in backend.

This commit is contained in:
Adam Treat 2023-06-26 11:42:11 -04:00
parent 5e520bb775
commit a0f80453e5
5 changed files with 4 additions and 5 deletions

View File

@ -78,7 +78,6 @@ qt_add_executable(chat
server.h server.cpp server.h server.cpp
logger.h logger.cpp logger.h logger.cpp
responsetext.h responsetext.cpp responsetext.h responsetext.cpp
sysinfo.h
${METAL_SHADER_FILE} ${METAL_SHADER_FILE}
) )

View File

@ -1,8 +1,8 @@
#include "llm.h" #include "llm.h"
#include "config.h" #include "config.h"
#include "sysinfo.h"
#include "chatlistmodel.h" #include "chatlistmodel.h"
#include "../gpt4all-backend/llmodel.h" #include "../gpt4all-backend/llmodel.h"
#include "../gpt4all-backend/sysinfo.h"
#include "network.h" #include "network.h"
#include <QCoreApplication> #include <QCoreApplication>

View File

@ -148,7 +148,7 @@ ModelInfo ModelList::defaultModelInfo() const
if (!info->installed) if (!info->installed)
continue; continue;
defaultModel = info; defaultModel = info;
if (!hasDefaultName && defaultModel->isDefault) break; if (!hasDefaultName) break;
if (hasDefaultName && (defaultModel->name == defaultModelName || defaultModel->filename == defaultModelName)) break; if (hasDefaultName && (defaultModel->name == defaultModelName || defaultModel->filename == defaultModelName)) break;
} }
if (defaultModel) if (defaultModel)

View File

@ -1,6 +1,6 @@
#include "network.h" #include "network.h"
#include "llm.h"
#include "chatlistmodel.h" #include "chatlistmodel.h"
#include "sysinfo.h"
#include <QCoreApplication> #include <QCoreApplication>
#include <QGuiApplication> #include <QGuiApplication>
@ -411,7 +411,7 @@ void Network::sendMixpanelEvent(const QString &ev, const QVector<KeyValue> &valu
if (ev == "startup") { if (ev == "startup") {
const QSize display = QGuiApplication::primaryScreen()->size(); const QSize display = QGuiApplication::primaryScreen()->size();
properties.insert("display", QString("%1x%2").arg(display.width()).arg(display.height())); properties.insert("display", QString("%1x%2").arg(display.width()).arg(display.height()));
properties.insert("ram", getSystemTotalRAMInGB()); properties.insert("ram", LLM::globalInstance()->systemTotalRAMInGB());
#if defined(Q_OS_MAC) #if defined(Q_OS_MAC)
properties.insert("cpu", QString::fromStdString(getCPUModel())); properties.insert("cpu", QString::fromStdString(getCPUModel()));
#endif #endif