Skip to content

Commit 4cf2aa3

Browse files
committed
whisper : load backends before loading the model
This commit adds a call to `whisper_load_backends()` in the `whisper_model_load` function. The motivation for this change is that currently is `GGML_BACKEND_DL` if enabled the model loading will crash because of a segment fault as the `cpu_dev` will be null in `make_buft_list` becasue it has not been loaded. There have been other suggestions to address this issue that were more involved than this change so there is a good chance that I missing something here, but this seemed like a simple change to make. Refs: #3182
1 parent b9d27b1 commit 4cf2aa3

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/whisper.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1506,6 +1506,7 @@ static ggml_backend_buffer_type_t select_weight_buft(const whisper_hparams & hpa
15061506
//
15071507
static bool whisper_model_load(struct whisper_model_loader * loader, whisper_context & wctx) {
15081508
WHISPER_LOG_INFO("%s: loading model\n", __func__);
1509+
whisper_load_backends();
15091510

15101511
const int64_t t_start_us = ggml_time_us();
15111512

0 commit comments

Comments
 (0)