Skip to content

Commit

Permalink
ggml : allow loading backend with env variable (#1059)
Browse files Browse the repository at this point in the history
ref: #1058
  • Loading branch information
rgerganov authored Jan 5, 2025
1 parent a2af72b commit c8bd0fe
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/ggml-backend-reg.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -574,4 +574,9 @@ void ggml_backend_load_all_from_path(const char * dir_path) {
ggml_backend_load_best("opencl", silent, dir_path);
ggml_backend_load_best("musa", silent, dir_path);
ggml_backend_load_best("cpu", silent, dir_path);
// check the environment variable GGML_BACKEND_PATH to load an out-of-tree backend
const char * backend_path = std::getenv("GGML_BACKEND_PATH");
if (backend_path) {
ggml_backend_load(backend_path);
}
}

0 comments on commit c8bd0fe

Please sign in to comment.