whisper : suppress non-speech-related token outputs (#473)

* add non-speech-token suppression

* add suppress non-speech_tokens param
This commit is contained in:
shibukazu
2023-02-08 16:05:34 +09:00
committed by GitHub
parent 2bfe0ebc0f
commit cfc06bf8df
2 changed files with 37 additions and 0 deletions

View File

@@ -285,6 +285,7 @@ extern "C" {
// common decoding parameters:
bool suppress_blank; // ref: https://github.com/openai/whisper/blob/f82bc59f5ea234d4b97fb2860842ed38519f7e65/whisper/decoding.py#L89
bool suppress_non_speech_tokens; // ref: https://github.com/openai/whisper/blob/7858aa9c08d98f75575035ecd6481f462d66ca27/whisper/tokenizer.py#L224-L253
float temperature; // initial decoding temperature, ref: https://ai.stackexchange.com/a/32478
float max_initial_ts; // ref: https://github.com/openai/whisper/blob/f82bc59f5ea234d4b97fb2860842ed38519f7e65/whisper/decoding.py#L97