From 8781b72c168b3088a62de92c9edef002e2f5069c Mon Sep 17 00:00:00 2001 From: jiltseb Date: Wed, 6 Nov 2024 11:00:41 +0000 Subject: [PATCH] adding without_timestamps and word_timestamps params to batched version --- aana/core/models/whisper.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/aana/core/models/whisper.py b/aana/core/models/whisper.py index 54c1a615..c46bcfd8 100644 --- a/aana/core/models/whisper.py +++ b/aana/core/models/whisper.py @@ -43,6 +43,10 @@ class WhisperParams(BaseModel): "Temperature for sampling. A single value or a sequence indicating fallback temperatures." ), ) + without_timestamps: bool = Field( + default=False, + description="Whether to sample only text tokens in decoding.", + ) word_timestamps: bool = Field( default=False, description="Whether to extract word-level timestamps." ) @@ -114,6 +118,13 @@ class BatchedWhisperParams(BaseModel): "Temperature for sampling. A single value or a sequence indicating fallback temperatures." ), ) + without_timestamps: bool = Field( + default=True, + description="Whether to sample only text tokens in decoding. Set to 'False' to get phrase-level time stamps (eg. for subtitles)", + ) + word_timestamps: bool = Field( + default=False, description="Whether to extract word-level timestamps." + ) @field_validator("temperature") @classmethod