mirror of
https://github.com/nomic-ai/gpt4all.git
synced 2025-07-03 18:48:19 +00:00
Fix for "LLModel ERROR: Could not find CPU LLaMA implementation" v2
This commit is contained in:
parent
38d81c14d0
commit
a0f7d7ae0e
@ -53,8 +53,9 @@ public:
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
#else
|
#else
|
||||||
#include <string>
|
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
|
#include <filesystem>
|
||||||
|
#include <string>
|
||||||
#include <exception>
|
#include <exception>
|
||||||
#include <stdexcept>
|
#include <stdexcept>
|
||||||
#ifndef NOMINMAX
|
#ifndef NOMINMAX
|
||||||
@ -76,9 +77,9 @@ public:
|
|||||||
|
|
||||||
Dlhandle() : chandle(nullptr) {}
|
Dlhandle() : chandle(nullptr) {}
|
||||||
Dlhandle(const std::string& fpath) {
|
Dlhandle(const std::string& fpath) {
|
||||||
std::string path = fpath;
|
std::string afpath = std::filesystem::absolute(fpath).string();
|
||||||
std::replace(path.begin(), path.end(), '/', '\\');
|
std::replace(afpath.begin(), afpath.end(), '/', '\\');
|
||||||
chandle = LoadLibraryExA(path.c_str(), NULL, LOAD_LIBRARY_SEARCH_DEFAULT_DIRS | LOAD_LIBRARY_SEARCH_DLL_LOAD_DIR);
|
chandle = LoadLibraryExA(afpath.c_str(), NULL, LOAD_LIBRARY_SEARCH_DEFAULT_DIRS | LOAD_LIBRARY_SEARCH_DLL_LOAD_DIR);
|
||||||
if (!chandle) {
|
if (!chandle) {
|
||||||
throw Exception("dlopen(\""+fpath+"\"): Error");
|
throw Exception("dlopen(\""+fpath+"\"): Error");
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user