* whisper : remove whisper_load_backends function
This commit removes the `whisper_load_backends` function, which was used
to load all GGML backends.
The motivation for this change push the responsibility of loading
backends to user applications to give them more control over which
backends to load and when. See the references below for more context.
Resolves: https://github.com/ggml-org/whisper.cpp/issues/3182
Refs: https://github.com/ggml-org/whisper.cpp/pull/3042#issuecomment-
2801778733
Refs: https://github.com/ggml-org/whisper.cpp/pull/3042#issuecomment-
2801928990
* ruby : add check for rwc is NULL
This commit adds a check to ensure that the `rwc` pointer is not NULL
before attempting to mark its members in the garbage collector.
The motivation for this is an attempt to see if this fixed the CI build
as I'm not able to reproduce the issue locally.
Refs: https://github.com/ggml-org/whisper.cpp/actions/runs/
15299612277/job/
43036694928?pr=3196
static void
rb_whisper_callbcack_container_mark(ruby_whisper_callback_container *rwc)
{
+ if (rwc == NULL) return;
+
rb_gc_mark(rwc->user_data);
rb_gc_mark(rwc->callback);
rb_gc_mark(rwc->callbacks);
}
int main(int argc, char ** argv) {
+ ggml_backend_load_all();
+
whisper_params params;
if (whisper_params_parse(argc, argv, params) == false) {
static void cb_log_disable(enum ggml_log_level , const char * , void * ) { }
int main(int argc, char ** argv) {
+ ggml_backend_load_all();
+
#if defined(_WIN32)
// Set the console output code page to UTF-8, while command line arguments
// are still encoded in the system's code page. In this way, we can print
}
// whisper init
-
struct whisper_context_params cparams = whisper_context_default_params();
cparams.use_gpu = params.use_gpu;
}
int main(int argc, char ** argv) {
+ ggml_backend_load_all();
+
whisper_params params;
if (whisper_params_parse(argc, argv, params) == false) {
}
int main(int argc, char ** argv) {
+ ggml_backend_load_all();
+
whisper_params params;
if (whisper_params_parse(argc, argv, params) == false) {
return 1;
#include "ggml.h"
+#include "ggml-backend.h"
#include "common.h"
#include "common-ggml.h"
}
int main(int argc, char ** argv) {
+ ggml_backend_load_all();
+
if (argc != 4) {
fprintf(stderr, "usage: %s model-f32.bin model-quant.bin type\n", argv[0]);
ggml_print_ftypes(stderr);
} // namespace
int main(int argc, char ** argv) {
+ ggml_backend_load_all();
+
whisper_params params;
server_params sparams;
}
int main(int argc, char ** argv) {
+ ggml_backend_load_all();
+
whisper_params params;
if (whisper_params_parse(argc, argv, params) == false) {
{0}{4})";
int main(int argc, char ** argv) {
+ ggml_backend_load_all();
+
whisper_params params;
if (whisper_params_parse(argc, argv, params) == false) {
static void cb_log_disable(enum ggml_log_level , const char * , void * ) { }
int main(int argc, char ** argv) {
+ ggml_backend_load_all();
+
cli_params cli_params;
if (!vad_params_parse(argc, argv, cli_params)) {
}
int main(int argc, char ** argv) {
+ ggml_backend_load_all();
+
whisper_params params;
if (whisper_params_parse(argc, argv, params) == false) {
return t;
}
-static void whisper_load_backends() {
-#ifdef GGML_BACKEND_DL
- static std::once_flag flag;
- std::call_once(flag, []() {
- ggml_backend_load_all();
- });
-#endif
-}
-
// TODO: move these functions to ggml-base with support for ggml-backend?
static ggml_tensor * whisper_set_f32(struct ggml_tensor * t, float v) {
static ggml_backend_t whisper_backend_init_gpu(const whisper_context_params & params) {
ggml_log_set(g_state.log_callback, g_state.log_callback_user_data);
- whisper_load_backends();
-
ggml_backend_dev_t dev = nullptr;
int cnt = 0;
const char * whisper_print_system_info(void) {
static std::string s;
- whisper_load_backends();
-
s = "";
s += "WHISPER : ";
s += "COREML = " + std::to_string(whisper_has_coreml()) + " | ";
}
WHISPER_API const char * whisper_bench_ggml_mul_mat_str(int n_threads) {
- whisper_load_backends();
-
static std::string s;
s = "";
char strbuf[256];