MBilal-72 commited on
Commit
528ca0f
·
verified ·
1 Parent(s): 241197a

Delete utils/audio_utils.py

Browse files
Files changed (1) hide show
  1. utils/audio_utils.py +0 -11
utils/audio_utils.py DELETED
@@ -1,11 +0,0 @@
1
- import whisper
2
- import tempfile
3
-
4
- # Transcribe uploaded audio file to text using Whisper
5
- def transcribe_audio(audio_file) -> str:
6
- model = whisper.load_model("base")
7
- with tempfile.NamedTemporaryFile(delete=False, suffix=".mp3") as tmp:
8
- tmp.write(audio_file.read())
9
- tmp_path = tmp.name
10
- result = model.transcribe(tmp_path)
11
- return result["text"]