From: Ben Nortier Date: Fri, 10 Nov 2023 11:51:16 +0000 (+0200) Subject: whisper : return with error from whisper_encode_internal and whisper_decode_internal... X-Git-Tag: upstream/1.7.4~1271 X-Git-Url: https://git.djapps.eu/?a=commitdiff_plain;h=ec7a6f04f9c32adec2e6b0995b8c728c5bf56f35;p=pkg%2Fggml%2Fsources%2Fwhisper.cpp whisper : return with error from whisper_encode_internal and whisper_decode_internal when abort callback is true (#1456) Co-authored-by: Ben Nortier --- diff --git a/whisper.cpp b/whisper.cpp index d36349b0..681727f5 100644 --- a/whisper.cpp +++ b/whisper.cpp @@ -2027,7 +2027,7 @@ static bool whisper_encode_internal( wstate.t_encode_us += ggml_time_us() - t_start_us; wstate.n_encode++; - return true; + return !(abort_callback && abort_callback(abort_callback_data)); } static struct ggml_cgraph * whisper_build_graph_decoder( @@ -2447,7 +2447,7 @@ static bool whisper_decode_internal( wstate.n_prompt++; } - return true; + return !(abort_callback && abort_callback(abort_callback_data)); }