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());