Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed with_state methods, to use the correct state #1519

Merged
merged 1 commit into from
Nov 19, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions whisper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3527,7 +3527,7 @@ int whisper_encode(struct whisper_context * ctx, int offset, int n_threads) {
int whisper_decode_with_state(struct whisper_context * ctx, struct whisper_state * state, const whisper_token * tokens, int n_tokens, int n_past, int n_threads) {
whisper_batch_prep_legacy(state->batch, tokens, n_tokens, n_past, 0);

whisper_kv_cache_seq_rm(ctx->state->kv_self, 0, n_past, -1);
whisper_kv_cache_seq_rm(state->kv_self, 0, n_past, -1);

if (!whisper_decode_internal(*ctx, *state, state->batch, n_threads, nullptr, nullptr)) {
WHISPER_LOG_ERROR("%s: failed to eval\n", __func__);
Expand Down Expand Up @@ -5188,7 +5188,7 @@ int whisper_full_with_state(
const int progress_cur = (100*(seek - seek_start))/(seek_end - seek_start);

params.progress_callback(
ctx, ctx->state, progress_cur, params.progress_callback_user_data);
ctx, state, progress_cur, params.progress_callback_user_data);
}

// of only 1 second left, then stop
Expand Down
Loading