From: 0/0 Date: Tue, 11 Oct 2022 17:49:48 +0000 (-0600) Subject: check if spectogram length is <100 before doing anything else X-Git-Tag: upstream/1.7.4~1960 X-Git-Url: https://git.djapps.eu/?a=commitdiff_plain;h=b7992269730ca48c7eee3904682cf5b01fd17787;p=pkg%2Fggml%2Fsources%2Fwhisper.cpp check if spectogram length is <100 before doing anything else fixes #39 --- diff --git a/whisper.cpp b/whisper.cpp index 91bac33b..a5f79d25 100644 --- a/whisper.cpp +++ b/whisper.cpp @@ -2320,6 +2320,13 @@ int whisper_full( 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 auto & prompt_past = ctx->prompt_past; if (params.no_context) {