stream : fix --keep_context argument to be used correctly (#354)

pull/415/head
Georgi Gerganov 2 years ago
parent 4a3f0d3fe9
commit c9aeb33676
No known key found for this signature in database
GPG Key ID: 449E073F9DC10735

@ -435,7 +435,7 @@ 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 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_timestamps = !use_vad;
params.no_context = use_vad; params.no_context |= use_vad;
params.max_tokens = 0; params.max_tokens = 0;
// init audio // init audio
@ -486,7 +486,7 @@ int main(int argc, char ** argv) {
params.no_timestamps ? 0 : 1); params.no_timestamps ? 0 : 1);
if (!use_vad) { 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 { } else {
fprintf(stderr, "%s: using VAD, will transcribe on speech activity\n", __func__); fprintf(stderr, "%s: using VAD, will transcribe on speech activity\n", __func__);
} }

@ -245,7 +245,7 @@ extern "C" {
int duration_ms; // audio duration to process in ms int duration_ms; // audio duration to process in ms
bool translate; 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 single_segment; // force single segment output (useful for streaming)
bool print_special; // print special tokens (e.g. <SOT>, <EOT>, <BEG>, etc.) bool print_special; // print special tokens (e.g. <SOT>, <EOT>, <BEG>, etc.)
bool print_progress; // print progress information bool print_progress; // print progress information

Loading…
Cancel
Save