burhan112 commited on
Commit
925719e
·
verified ·
1 Parent(s): 7983775

Create asr.py

Browse files
Files changed (1) hide show
  1. asr.py +10 -0
asr.py ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
 
1
+ import whisper
2
+
3
+ # Load Whisper model
4
+ asr_model = whisper.load_model("small")
5
+
6
+ def transcribe_audio(audio_path: str) -> str:
7
+ result = asr_model.transcribe(audio_path, language='en')
8
+ question = result["text"]
9
+ print("Transcribed Question:", question)
10
+ return question