Allow user to specify custom search path via $GPT4ALL_IMPLEMENTATIONS_PATH (#789)

This commit is contained in:
niansa/tuxifan 2023-06-01 17:41:04 +02:00 committed by GitHub
parent 5175db2781
commit 27e80e1d10
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -6,6 +6,7 @@
#include <fstream>
#include <filesystem>
#include <cassert>
#include <cstdlib>
static bool requires_avxonly() {
#ifdef __x86_64__
@ -73,7 +74,8 @@ const std::vector<LLModel::Implementation> &LLModel::implementationList() {
}
};
search_in_directory(".");
const char *custom_impl_lookup_path = getenv("GPT4ALL_IMPLEMENTATIONS_PATH");
search_in_directory(custom_impl_lookup_path?custom_impl_lookup_path:".");
#if defined(__APPLE__)
search_in_directory("../../../");
#endif