feat: remove old refs, check for prompt size

pull/163/head
Eren Akbiyik 3 years ago
parent a3a911171c
commit 78d9b2a15b

@ -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]);

@ -3,7 +3,6 @@
#include <stdint.h>
#include <stdbool.h>
#include <vector>
#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<whisper_token>: tokents to provide the whisper model as initial prompt
// std::vector<whisper_token>: tokens to provide the whisper model as initial prompt
const whisper_token * prompt_tokens;
int prompt_n_tokens;

Loading…
Cancel
Save