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 ab56119470
commit c4f9535fd0

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