Skip to content

Commit

Permalink
Change
Browse files Browse the repository at this point in the history
  • Loading branch information
jordimas committed Jan 1, 2025
1 parent 1a4b8ee commit c4257a1
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions src/whisper_ctranslate2/commandline.py
Original file line number Diff line number Diff line change
Expand Up @@ -381,10 +381,10 @@ def read_command_line():
)

vad_args.add_argument(
"--vad_onset",
"--vad_threshold",
type=float,
default=None,
help="when `vad_filter` is enabled, probabilities above this value are considered as speech. This parameter was called `vad_threshold` before",
help="when `vad_filter` is enabled, probabilities above this value are considered as speech",
)

vad_args.add_argument(
Expand Down
6 changes: 3 additions & 3 deletions src/whisper_ctranslate2/transcribe.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ class TranscriptionOptions(NamedTuple):
append_punctuations: str
hallucination_silence_threshold: Optional[float]
vad_filter: bool
vad_onset: Optional[float]
vad_threshold: Optional[float]
vad_min_speech_duration_ms: Optional[int]
vad_max_speech_duration_s: Optional[int]
vad_min_silence_duration_ms: Optional[int]
Expand Down Expand Up @@ -84,8 +84,8 @@ def _get_colored_text(self, words):
def _get_vad_parameters_dictionary(self, options):
vad_parameters = {}

if options.vad_onset:
vad_parameters["onset"] = options.vad_onset
if options.vad_threshold:
vad_parameters["vad_threshold"] = options.vad_threshold

if options.vad_min_speech_duration_ms:
vad_parameters["min_speech_duration_ms"] = (
Expand Down
2 changes: 1 addition & 1 deletion src/whisper_ctranslate2/whisper_ctranslate2.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ def get_transcription_options(args):
print_colors=args.pop("print_colors"),
hallucination_silence_threshold=args.pop("hallucination_silence_threshold"),
vad_filter=args.pop("vad_filter"),
vad_onset=args.pop("vad_onset"),
vad_threshold=args.pop("vad_threshold"),
vad_min_speech_duration_ms=args.pop("vad_min_speech_duration_ms"),
vad_max_speech_duration_s=args.pop("vad_max_speech_duration_s"),
vad_min_silence_duration_ms=args.pop("vad_min_silence_duration_ms"),
Expand Down

0 comments on commit c4257a1

Please sign in to comment.