diff --git a/examples/bench/bench.cpp b/examples/bench/bench.cpp index 54f73110d42..61a00ac50db 100644 --- a/examples/bench/bench.cpp +++ b/examples/bench/bench.cpp @@ -60,6 +60,9 @@ void whisper_print_usage(int /*argc*/, char ** argv, const whisper_params & para static int whisper_bench_full(const whisper_params & params) { // whisper init + #ifdef GGML_BACKEND_DL + whisper_load_backends(); + #endif struct whisper_context_params cparams = whisper_context_default_params(); diff --git a/examples/cli/cli.cpp b/examples/cli/cli.cpp index 4b2b3521b80..ffa626c69c7 100644 --- a/examples/cli/cli.cpp +++ b/examples/cli/cli.cpp @@ -1004,6 +1004,10 @@ int main(int argc, char ** argv) { // whisper init + #ifdef GGML_BACKEND_DL + whisper_load_backends(); + #endif + struct whisper_context_params cparams = whisper_context_default_params(); cparams.use_gpu = params.use_gpu; diff --git a/examples/stream/stream.cpp b/examples/stream/stream.cpp index 65c6587db92..f58001e16b4 100644 --- a/examples/stream/stream.cpp +++ b/examples/stream/stream.cpp @@ -155,6 +155,10 @@ int main(int argc, char ** argv) { exit(0); } + #ifdef GGML_BACKEND_DL + whisper_load_backends(); + #endif + struct whisper_context_params cparams = whisper_context_default_params(); cparams.use_gpu = params.use_gpu; diff --git a/include/whisper.h b/include/whisper.h index 1e1375033ad..42c7632128e 100644 --- a/include/whisper.h +++ b/include/whisper.h @@ -259,6 +259,11 @@ extern "C" { WHISPER_API void whisper_free_params(struct whisper_full_params * params); WHISPER_API void whisper_free_context_params(struct whisper_context_params * params); + // Required for GGML_BACKEND_DL + #ifdef GGML_BACKEND_DL + WHISPER_API void whisper_load_backends(); + #endif + // Convert RAW PCM audio to log mel spectrogram. // The resulting spectrogram is stored inside the default state of the provided whisper context. // Returns 0 on success