diff --git a/whisper.cpp b/whisper.cpp index f8c1ada..3633cdb 100644 --- a/whisper.cpp +++ b/whisper.cpp @@ -2591,7 +2591,7 @@ int whisper_full( } // Prepend the prompt tokens to the prompt_past - if (params.prompt_tokens) { + if (params.prompt_tokens && params.prompt_n_tokens > 0) { // Parse tokens from the pointer (it points to an std::vector) for (int i = 0; i < params.prompt_n_tokens; i++) { prompt_past.push_back(params.prompt_tokens[i]); diff --git a/whisper.h b/whisper.h index ad989e9..1b2a042 100644 --- a/whisper.h +++ b/whisper.h @@ -3,7 +3,6 @@ #include #include -#include #ifdef WHISPER_SHARED # ifdef _WIN32 @@ -209,7 +208,7 @@ extern "C" { bool speed_up; // speed-up the audio by 2x using Phase Vocoder int audio_ctx; // overwrite the audio context size (0 = use default) - // std::vector: tokents to provide the whisper model as initial prompt + // std::vector: tokens to provide the whisper model as initial prompt const whisper_token * prompt_tokens; int prompt_n_tokens;