Spaces:
Sleeping
Sleeping
File size: 473 Bytes
5a5d614 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 |
from faster_whisper import WhisperModel
model_size = "turbo"
model = WhisperModel(model_size, device="cpu", compute_type="int8")
def audio_transcribe(audio_path) -> str:
segments, info = model.transcribe(audio_path, beam_size=5)
full_transcript = " ".join([segment.text for segment in segments])
return full_transcript
if __name__ == "__main__":
audio_path = "T0055G0007S0001.wav"
transcript = audio_transcribe(audio_path)
print(transcript) |