Spaces:
Sleeping
Sleeping
ShobhitKori
commited on
Commit
·
4df0d17
1
Parent(s):
4902930
Updated whisper_model.py
Browse files- whisper_model.py +12 -3
whisper_model.py
CHANGED
|
@@ -4,9 +4,18 @@ import os
|
|
| 4 |
os.environ["PATH"] += os.pathsep + r"C:\ffmpeg\bin"
|
| 5 |
|
| 6 |
import whisper
|
|
|
|
| 7 |
|
| 8 |
model = whisper.load_model("small")
|
| 9 |
|
| 10 |
-
def transcribe_audio(file_path: str) -> str:
|
| 11 |
-
|
| 12 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 4 |
os.environ["PATH"] += os.pathsep + r"C:\ffmpeg\bin"
|
| 5 |
|
| 6 |
import whisper
|
| 7 |
+
import logging
|
| 8 |
|
| 9 |
model = whisper.load_model("small")
|
| 10 |
|
| 11 |
+
# def transcribe_audio(file_path: str) -> str:
|
| 12 |
+
# result = model.transcribe(file_path)
|
| 13 |
+
# return result["text"]
|
| 14 |
+
|
| 15 |
+
logging.basicConfig(level=logging.INFO)
|
| 16 |
+
|
| 17 |
+
def transcribe_audio(file_path):
|
| 18 |
+
logging.info("Starting transcription for %s", file_path)
|
| 19 |
+
result = model.transcribe(file_path)
|
| 20 |
+
logging.info("Transcription completed")
|
| 21 |
+
return result["text"]
|