Skip to content

Faster Whisper transcription with CTranslate2

change language_detection_threshold type to float (#1188)

Nicholascdac682679df
diff --git a/faster_whisper/transcribe.py b/faster_whisper/transcribe.py
index bf1d017..6e6abec 100644
--- a/faster_whisper/transcribe.py
+++ b/faster_whisper/transcribe.py
@@ -294,7 +294,7 @@ class BatchedInferencePipeline:
hallucination_silence_threshold: Optional[float] = None,
batch_size: int = 8,
hotwords: Optional[str] = None,
- language_detection_threshold: Optional[float] = 0.5,
+ language_detection_threshold: float = 0.5,
language_detection_segments: int = 1,
) -> Tuple[Iterable[Segment], TranscriptionInfo]:
"""transcribe audio in chunks in batched fashion and return with language info.
@@ -789,7 +789,7 @@ class WhisperModel:
clip_timestamps: Union[str, List[float]] = "0",
hallucination_silence_threshold: Optional[float] = None,
hotwords: Optional[str] = None,
- language_detection_threshold: Optional[float] = 0.5,
+ language_detection_threshold: float = 0.5,
language_detection_segments: int = 1,
) -> Tuple[Iterable[Segment], TranscriptionInfo]:
"""Transcribes an input file.