aazankhanYousafzai's picture
Create stt.py
34552ed verified
raw
history blame contribute delete
230 Bytes
# stt.py
import whisper
print("Loading Whisper model...")
model = whisper.load_model("base")
print("Whisper loaded")
def speech_to_text(audio_path: str) -> str:
result = model.transcribe(audio_path)
return result["text"]