ref #48 : clear results at the start of whisper_full

This way, even if the input audio is empty, the previous results will be
removed.
pull/58/head
Georgi Gerganov 2 years ago
parent 36945162fa
commit 0ad085f5e8
No known key found for this signature in database
GPG Key ID: 449E073F9DC10735

@ -2314,6 +2314,12 @@ int whisper_full(
struct whisper_full_params params,
const float * samples,
int n_samples) {
// clear old results
auto & result_all = ctx->result_all;
auto & result_cur = ctx->result_cur;
result_all.clear();
// compute log mel spectrogram
if (whisper_pcm_to_mel(ctx, samples, n_samples, params.n_threads) != 0) {
fprintf(stderr, "%s: failed to compute log mel spectrogram\n", __func__);
@ -2344,11 +2350,6 @@ int whisper_full(
}
}
auto & result_all = ctx->result_all;
auto & result_cur = ctx->result_cur;
result_all.clear();
int progress_prev = 0;
int progress_step = 5;

Loading…
Cancel
Save