Spaces:
Sleeping
Sleeping
transcribe only English.
Browse files
app.py
CHANGED
|
@@ -29,7 +29,7 @@ stt_model = WhisperModel(WHISPER_SIZE, device="cuda" if os.environ.get("CUDA_VIS
|
|
| 29 |
compute_type="float16" if os.environ.get("CUDA_VISIBLE_DEVICES") else "int8")
|
| 30 |
|
| 31 |
def speech_to_text(audio_path: str) -> str:
|
| 32 |
-
segments, info = stt_model.transcribe(audio_path, beam_size=1, vad_filter=True)
|
| 33 |
text = "".join(seg.text for seg in segments).strip()
|
| 34 |
return text
|
| 35 |
|
|
|
|
| 29 |
compute_type="float16" if os.environ.get("CUDA_VISIBLE_DEVICES") else "int8")
|
| 30 |
|
| 31 |
def speech_to_text(audio_path: str) -> str:
|
| 32 |
+
segments, info = stt_model.transcribe(audio_path, beam_size=1, vad_filter=True, language="en")
|
| 33 |
text = "".join(seg.text for seg in segments).strip()
|
| 34 |
return text
|
| 35 |
|