check if spectogram length is <100 before doing anything else

fixes #39
pull/41/head
0/0 3 years ago
parent 8d94358251
commit ef762e1447
No known key found for this signature in database
GPG Key ID: DE8D5010C0AAA3DC

@ -2318,6 +2318,13 @@ int whisper_full(
return -1; return -1;
} }
// if length of spectrogram is less than 1s (100 samples), then return
// basically don't process anything that is less than 1s
// see issue #39: https://github.com/ggerganov/whisper.cpp/issues/39
if (whisper_n_len(ctx) < 100) {
return 0;
}
// the accumulated text context so far // the accumulated text context so far
auto & prompt_past = ctx->prompt_past; auto & prompt_past = ctx->prompt_past;
if (params.no_context) { if (params.no_context) {

Loading…
Cancel
Save