mirror of
https://github.com/nomic-ai/gpt4all.git
synced 2025-09-11 21:39:11 +00:00
chat: set search path early
This fixes the issues with installed versions of v2.6.0.
This commit is contained in:
@@ -1,9 +1,8 @@
|
||||
#include <QDirIterator>
|
||||
#include <QGuiApplication>
|
||||
#include <QQmlApplicationEngine>
|
||||
#include <QQmlContext>
|
||||
|
||||
#include <QDirIterator>
|
||||
|
||||
#include "llm.h"
|
||||
#include "modellist.h"
|
||||
#include "chatlistmodel.h"
|
||||
@@ -13,6 +12,7 @@
|
||||
#include "mysettings.h"
|
||||
#include "config.h"
|
||||
#include "logger.h"
|
||||
#include "../gpt4all-backend/llmodel.h"
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
@@ -25,6 +25,21 @@ int main(int argc, char *argv[])
|
||||
|
||||
QGuiApplication app(argc, argv);
|
||||
QQmlApplicationEngine engine;
|
||||
|
||||
QString llmodelSearchPaths = QCoreApplication::applicationDirPath();
|
||||
const QString libDir = QCoreApplication::applicationDirPath() + "/../lib/";
|
||||
if (LLM::directoryExists(libDir))
|
||||
llmodelSearchPaths += ";" + libDir;
|
||||
#if defined(Q_OS_MAC)
|
||||
const QString binDir = QCoreApplication::applicationDirPath() + "/../../../";
|
||||
if (LLM::directoryExists(binDir))
|
||||
llmodelSearchPaths += ";" + binDir;
|
||||
const QString frameworksDir = QCoreApplication::applicationDirPath() + "/../Frameworks/";
|
||||
if (LLM::directoryExists(frameworksDir))
|
||||
llmodelSearchPaths += ";" + frameworksDir;
|
||||
#endif
|
||||
LLModel::Implementation::setImplementationsSearchPath(llmodelSearchPaths.toStdString());
|
||||
|
||||
qmlRegisterSingletonInstance("mysettings", 1, 0, "MySettings", MySettings::globalInstance());
|
||||
qmlRegisterSingletonInstance("modellist", 1, 0, "ModelList", ModelList::globalInstance());
|
||||
qmlRegisterSingletonInstance("chatlistmodel", 1, 0, "ChatListModel", ChatListModel::globalInstance());
|
||||
|
Reference in New Issue
Block a user