stream : add "max_tokens" parameter

Used to limit the number of tokens in a segment.
Useful to battle with word repetition when using partial encoder context
This commit is contained in:
Georgi Gerganov
2022-11-20 20:52:24 +02:00
parent d351771a4b
commit 62b5ff875c
3 changed files with 5 additions and 2 deletions

View File

@ -322,6 +322,7 @@ int main(int argc, char ** argv) {
{
whisper_full_params wparams = whisper_full_default_params(WHISPER_SAMPLING_GREEDY);
wparams.max_tokens = 32;
wparams.print_progress = false;
wparams.print_special_tokens = params.print_special_tokens;
wparams.print_realtime = false;