Spaces:
Running
Running
ggml : allow loading backend with env variable (ggml/1059)
Browse files
ggml/src/ggml-backend-reg.cpp
CHANGED
|
@@ -574,4 +574,9 @@ void ggml_backend_load_all_from_path(const char * dir_path) {
|
|
| 574 |
ggml_backend_load_best("opencl", silent, dir_path);
|
| 575 |
ggml_backend_load_best("musa", silent, dir_path);
|
| 576 |
ggml_backend_load_best("cpu", silent, dir_path);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 577 |
}
|
|
|
|
| 574 |
ggml_backend_load_best("opencl", silent, dir_path);
|
| 575 |
ggml_backend_load_best("musa", silent, dir_path);
|
| 576 |
ggml_backend_load_best("cpu", silent, dir_path);
|
| 577 |
+
// check the environment variable GGML_BACKEND_PATH to load an out-of-tree backend
|
| 578 |
+
const char * backend_path = std::getenv("GGML_BACKEND_PATH");
|
| 579 |
+
if (backend_path) {
|
| 580 |
+
ggml_backend_load(backend_path);
|
| 581 |
+
}
|
| 582 |
}
|