mirror of
https://github.com/m-bain/whisperX.git
synced 2025-07-01 18:17:27 -04:00
switch from case to ifelse
This commit is contained in:
@ -397,11 +397,12 @@ def load_model(
|
||||
print("Use manually assigned vad_model. vad_method is ignored.")
|
||||
vad_model = vad_model
|
||||
else:
|
||||
match vad_method:
|
||||
case "silero":
|
||||
if vad_method == "silero":
|
||||
vad_model = whisperx.vads.Silero(**default_vad_options)
|
||||
case "pyannote" | _:
|
||||
elif vad_method == "pyannote":
|
||||
vad_model = whisperx.vads.Pyannote(torch.device(device), use_auth_token=None, **default_vad_options)
|
||||
else:
|
||||
raise ValueError(f"Invalid vad_method: {vad_method}")
|
||||
|
||||
return FasterWhisperPipeline(
|
||||
model=model,
|
||||
|
Reference in New Issue
Block a user