Merge pull request #398 from AlexStansfield/feature/faster-whisper-1.2.0

feat: update to support faster whisper 1.2.0
This commit is contained in:
Vineet Suryan
2026-02-11 17:57:05 +05:30
committed by GitHub
3 changed files with 3 additions and 5 deletions
+1 -1
View File
@@ -1,4 +1,4 @@
faster-whisper==1.1.0 faster-whisper==1.2.0
websockets websockets
onnxruntime==1.17.0 onnxruntime==1.17.0
numba numba
@@ -76,7 +76,7 @@ class ServeClientFasterWhisper(ServeClientBase):
self.language = "en" if self.model_size_or_path.endswith("en") else language self.language = "en" if self.model_size_or_path.endswith("en") else language
self.task = task self.task = task
self.initial_prompt = initial_prompt self.initial_prompt = initial_prompt
self.vad_parameters = vad_parameters or {"onset": 0.5} self.vad_parameters = vad_parameters or {"threshold": 0.5}
device = "cuda" if torch.cuda.is_available() else "cpu" device = "cuda" if torch.cuda.is_available() else "cpu"
if device == "cuda": if device == "cuda":
@@ -27,7 +27,6 @@ from faster_whisper.vad import (
VadOptions, VadOptions,
collect_chunks, collect_chunks,
get_speech_timestamps, get_speech_timestamps,
merge_segments,
) )
@@ -407,8 +406,7 @@ class BatchedInferencePipeline:
**vad_parameters, max_speech_duration_s=chunk_length **vad_parameters, max_speech_duration_s=chunk_length
) )
active_segments = get_speech_timestamps(audio, vad_parameters) clip_timestamps = get_speech_timestamps(audio, vad_parameters)
clip_timestamps = merge_segments(active_segments, vad_parameters)
# run the audio if it is less than 30 sec even without clip_timestamps # run the audio if it is less than 30 sec even without clip_timestamps
elif duration < chunk_length: elif duration < chunk_length:
clip_timestamps = [{"start": 0, "end": audio.shape[0]}] clip_timestamps = [{"start": 0, "end": audio.shape[0]}]