Skip to content

Commit

Permalink
stream : fix --keep_context argument to be used correctly (ggerganov#354
Browse files Browse the repository at this point in the history
)
  • Loading branch information
ggerganov authored and rock3125 committed Feb 21, 2023
1 parent 4fc9d72 commit f263d72
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions examples/stream/stream.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -434,9 +434,9 @@ int main(int argc, char ** argv) {

const int n_new_line = !use_vad ? params.length_ms / params.step_ms - 1 : 1; // number of steps to print new line

params.no_timestamps = !use_vad;
params.no_context = use_vad;
params.max_tokens = 0;
params.no_timestamps = !use_vad;
params.no_context |= use_vad;
params.max_tokens = 0;

// init audio

Expand Down Expand Up @@ -486,7 +486,7 @@ int main(int argc, char ** argv) {
params.no_timestamps ? 0 : 1);

if (!use_vad) {
fprintf(stderr, "%s: n_new_line = %d\n", __func__, n_new_line);
fprintf(stderr, "%s: n_new_line = %d, no_context = %d\n", __func__, n_new_line, params.no_context);
} else {
fprintf(stderr, "%s: using VAD, will transcribe on speech activity\n", __func__);
}
Expand Down
2 changes: 1 addition & 1 deletion whisper.h
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,7 @@ extern "C" {
int duration_ms; // audio duration to process in ms

bool translate;
bool no_context; // do not use initial prompt for the decoder (if any)
bool no_context; // do not use past transcription (if any) as initial prompt for the decoder
bool single_segment; // force single segment output (useful for streaming)
bool print_special; // print special tokens (e.g. <SOT>, <EOT>, <BEG>, etc.)
bool print_progress; // print progress information
Expand Down

0 comments on commit f263d72

Please sign in to comment.