Create asr.py
Browse files
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
|