From c4f9535fd0e03995c1ecaa501e29fc3a17254c4c Mon Sep 17 00:00:00 2001 From: niansa/tuxifan Date: Thu, 1 Jun 2023 17:41:04 +0200 Subject: [PATCH] Allow user to specify custom search path via $GPT4ALL_IMPLEMENTATIONS_PATH (#789) --- gpt4all-backend/llmodel.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/gpt4all-backend/llmodel.cpp b/gpt4all-backend/llmodel.cpp index 5dfa1111..b78370ae 100644 --- a/gpt4all-backend/llmodel.cpp +++ b/gpt4all-backend/llmodel.cpp @@ -6,6 +6,7 @@ #include #include #include +#include static bool requires_avxonly() { #ifdef __x86_64__ @@ -73,7 +74,8 @@ const std::vector &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