File size: 265 Bytes
68f7e32
 
075eaf6
68f7e32
 
 
075eaf6
1
2
3
4
5
6
7
8
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)