Skip to content

Commit ec7a6f0

Browse files
authored
whisper : return with error from whisper_encode_internal and whisper_decode_internal when abort callback is true (#1456)
Co-authored-by: Ben Nortier <[email protected]>
1 parent 3794720 commit ec7a6f0

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

whisper.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2027,7 +2027,7 @@ static bool whisper_encode_internal(
20272027
wstate.t_encode_us += ggml_time_us() - t_start_us;
20282028
wstate.n_encode++;
20292029

2030-
return true;
2030+
return !(abort_callback && abort_callback(abort_callback_data));
20312031
}
20322032

20332033
static struct ggml_cgraph * whisper_build_graph_decoder(
@@ -2447,7 +2447,7 @@ static bool whisper_decode_internal(
24472447
wstate.n_prompt++;
24482448
}
24492449

2450-
return true;
2450+
return !(abort_callback && abort_callback(abort_callback_data));
24512451
}
24522452

24532453

0 commit comments

Comments
 (0)