Spaces:
Sleeping
Sleeping
Update tools/asr_tool.py
Browse files- tools/asr_tool.py +3 -2
tools/asr_tool.py
CHANGED
@@ -1,7 +1,8 @@
|
|
1 |
from faster_whisper import WhisperModel
|
2 |
|
3 |
-
model = WhisperModel("base", device="cpu"
|
4 |
|
5 |
def transcribe_audio(audio_path: str) -> str:
|
6 |
segments, _ = model.transcribe(audio_path)
|
7 |
-
|
|
|
|
1 |
from faster_whisper import WhisperModel
|
2 |
|
3 |
+
model = WhisperModel("base", device="cpu")
|
4 |
|
5 |
def transcribe_audio(audio_path: str) -> str:
|
6 |
segments, _ = model.transcribe(audio_path)
|
7 |
+
transcription = " ".join(segment.text for segment in segments)
|
8 |
+
return transcription or "No transcription found."
|