mirror of
https://github.com/nomic-ai/gpt4all.git
synced 2025-09-05 10:30:29 +00:00
chat: set search path early
This fixes the issues with installed versions of v2.6.0.
This commit is contained in:
@@ -1,15 +1,14 @@
|
||||
#include "llm.h"
|
||||
#include "../gpt4all-backend/sysinfo.h"
|
||||
#include "../gpt4all-backend/llmodel.h"
|
||||
#include "network.h"
|
||||
|
||||
#include <QCoreApplication>
|
||||
#include <QDesktopServices>
|
||||
#include <QDir>
|
||||
#include <QFile>
|
||||
#include <QProcess>
|
||||
#include <QResource>
|
||||
#include <QSettings>
|
||||
#include <QDesktopServices>
|
||||
#include <QUrl>
|
||||
#include <fstream>
|
||||
|
||||
class MyLLM: public LLM { };
|
||||
@@ -23,20 +22,6 @@ LLM::LLM()
|
||||
: QObject{nullptr}
|
||||
, m_compatHardware(true)
|
||||
{
|
||||
QString llmodelSearchPaths = QCoreApplication::applicationDirPath();
|
||||
const QString libDir = QCoreApplication::applicationDirPath() + "/../lib/";
|
||||
if (directoryExists(libDir))
|
||||
llmodelSearchPaths += ";" + libDir;
|
||||
#if defined(Q_OS_MAC)
|
||||
const QString binDir = QCoreApplication::applicationDirPath() + "/../../../";
|
||||
if (directoryExists(binDir))
|
||||
llmodelSearchPaths += ";" + binDir;
|
||||
const QString frameworksDir = QCoreApplication::applicationDirPath() + "/../Frameworks/";
|
||||
if (directoryExists(frameworksDir))
|
||||
llmodelSearchPaths += ";" + frameworksDir;
|
||||
#endif
|
||||
LLModel::Implementation::setImplementationsSearchPath(llmodelSearchPaths.toStdString());
|
||||
|
||||
#if defined(__x86_64__)
|
||||
#ifndef _MSC_VER
|
||||
const bool minimal(__builtin_cpu_supports("avx"));
|
||||
@@ -86,7 +71,7 @@ bool LLM::checkForUpdates() const
|
||||
#endif
|
||||
}
|
||||
|
||||
bool LLM::directoryExists(const QString &path) const
|
||||
bool LLM::directoryExists(const QString &path)
|
||||
{
|
||||
const QUrl url(path);
|
||||
const QString localFilePath = url.isLocalFile() ? url.toLocalFile() : path;
|
||||
@@ -94,7 +79,7 @@ bool LLM::directoryExists(const QString &path) const
|
||||
return info.exists() && info.isDir();
|
||||
}
|
||||
|
||||
bool LLM::fileExists(const QString &path) const
|
||||
bool LLM::fileExists(const QString &path)
|
||||
{
|
||||
const QUrl url(path);
|
||||
const QString localFilePath = url.isLocalFile() ? url.toLocalFile() : path;
|
||||
|
Reference in New Issue
Block a user