Skip to content

Commit

Permalink
whisper : return with error from whisper_encode_internal and whisper_…
Browse files Browse the repository at this point in the history
…decode_internal when abort callback is true (ggerganov#1456)

Co-authored-by: Ben Nortier <ben@bjnortier.com>
  • Loading branch information
bjnortier and Ben Nortier committed Nov 10, 2023
1 parent 5e50f6e commit 388bc5b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions whisper.cpp
Expand Up @@ -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(
Expand Down Expand Up @@ -2447,7 +2447,7 @@ static bool whisper_decode_internal(
wstate.n_prompt++;
}

return true;
return !(abort_callback && abort_callback(abort_callback_data));
}


Expand Down

0 comments on commit 388bc5b

Please sign in to comment.