Skip to content

Commit

Permalink
Foolproof: Disable VAD if clip_timestamps is in use (#769)
Browse files Browse the repository at this point in the history
* Foolproof: Disable VAD if clip_timestamps is in use

Prevent silly things to happen.
  • Loading branch information
Purfview authored Apr 2, 2024
1 parent 8ae82c8 commit b024972
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion faster_whisper/transcribe.py
Original file line number Diff line number Diff line change
Expand Up @@ -280,6 +280,7 @@ def transcribe(
clip_timestamps: Union[str, List[float]]
Comma-separated list start,end,start,end,... timestamps (in seconds) of clips to
process. The last end timestamp defaults to the end of the file.
vad_filter will be ignored if clip_timestamps is used.
hallucination_silence_threshold: Optional[float]
When word_timestamps is True, skip silent periods longer than this threshold
(in seconds) when a possible hallucination is detected
Expand All @@ -305,7 +306,7 @@ def transcribe(
"Processing audio with duration %s", format_timestamp(duration)
)

if vad_filter:
if vad_filter and clip_timestamps == "0":
if vad_parameters is None:
vad_parameters = VadOptions()
elif isinstance(vad_parameters, dict):
Expand Down

0 comments on commit b024972

Please sign in to comment.