Skip to content

Commit

Permalink
ggml : allow setting the backend name with env variable
Browse files Browse the repository at this point in the history
  • Loading branch information
rgerganov committed Jan 3, 2025
1 parent 6a7a034 commit 51c38a2
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 @@ -549,4 +549,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_NAME to load an out-of-tree backend
const char * backend_name = std::getenv("GGML_BACKEND_NAME");
if (backend_name) {
ggml_backend_load_best(backend_name, silent, dir_path);
}
}

0 comments on commit 51c38a2

Please sign in to comment.