From b7d947b01d290a22537135412c28e39edc7fd3bf Mon Sep 17 00:00:00 2001 From: Adam Treat Date: Mon, 5 Jun 2023 09:30:50 -0400 Subject: [PATCH] Try and fix mac. --- gpt4all-chat/llm.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/gpt4all-chat/llm.cpp b/gpt4all-chat/llm.cpp index 388bdccf..43b3c8b3 100644 --- a/gpt4all-chat/llm.cpp +++ b/gpt4all-chat/llm.cpp @@ -27,8 +27,12 @@ LLM::LLM() { QString llmodelSearchPaths = QCoreApplication::applicationDirPath(); #if defined(Q_OS_MAC) - llmodelSearchPaths += ";" + QCoreApplication::applicationDirPath() + "../../../"; - llmodelSearchPaths += ";" + QCoreApplication::applicationDirPath() + "../Frameworks/"; + const QString binDir = QCoreApplication::applicationDirPath() + "/../../../"; + if (directoryExists(binDir) + llmodelSearchPaths += ";" + binDir; + const QString frameworksDir = QCoreApplication::applicationDirPath() + "/../Frameworks/"; + if (directoryExists(frameworksDir) + llmodelSearchPaths += ";" + frameworksDir; #endif LLModel::setImplementationsSearchPath(llmodelSearchPaths.toStdString());