Freddolin's picture
Update tools/asr_tool.py
075eaf6 verified
raw
history blame
265 Bytes
from faster_whisper import WhisperModel
model = WhisperModel("base", device="cpu", compute_type="int8")
def transcribe_audio(audio_path: str) -> str:
segments, _ = model.transcribe(audio_path)
return " ".join(segment.text.strip() for segment in segments)