translation-audio / audio /engine.py
mohameddalii's picture
Add Cohere Transcribe Arabic backend for Whisper vs Cohere compare
81e4eed verified
Raw History Blame Contribute Delete
513 Bytes
from __future__ import annotations
from collections.abc import Iterator
from typing import Any, Protocol
from shared.contracts import Transcript
class AsrEngine(Protocol):
backend: str
model_name: str
device: str
compute_type: str
replicas: int
batch_size: int
def transcribe(self, wav_path, language: str | None = None) -> Transcript: ...
def transcribe_events(
self, wav_path, language: str | None = None
) -> Iterator[dict[str, Any]]: ...