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