Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 8 additions & 3 deletions src/asr/faster_whisper_asr.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,10 +112,15 @@

class FasterWhisperASR(ASRInterface):
def __init__(self, **kwargs):
model_size = kwargs.get("model_size", "large-v3")
# Run on GPU with FP16
model_size_or_path = kwargs.get("model_size_or_path", kwargs.get("model_size", "large-v3"))
device = kwargs.get("device", "cuda")
compute_type = kwargs.get("compute_type", "float16")

# Run on GPU with FP16 by default, or use provided parameters
self.asr_pipeline = WhisperModel(
model_size, device="cuda", compute_type="float16"
model_size_or_path,
device=device,
compute_type=compute_type
)

async def transcribe(self, client):
Expand Down
16 changes: 3 additions & 13 deletions src/vad/vad_factory.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
from .pyannote_vad import PyannoteVAD


class VADFactory:
"""
Factory for creating instances of VAD systems.
Expand All @@ -10,15 +7,8 @@ class VADFactory:
def create_vad_pipeline(type, **kwargs):
"""
Creates a VAD pipeline based on the specified type.

Args:
type (str): The type of VAD pipeline to create (e.g., 'pyannote').
kwargs: Additional arguments for the VAD pipeline creation.

Returns:
VADInterface: An instance of a class that implements VADInterface.
"""
if type == "pyannote":
return PyannoteVAD(**kwargs)
if type == "none" or type is None:
return None
else:
raise ValueError(f"Unknown VAD pipeline type: {type}")
raise ValueError(f"VAD type '{type}' not available. Use 'none' to disable VAD.")