Add property WhisperModel.supported_languages (#476)

* Expose function supported_languages

* Make it a method
This commit is contained in:
Guillaume Klein
2023-09-14 17:42:02 +02:00
committed by GitHub
parent 0048844f54
commit e94711bb5c
2 changed files with 11 additions and 1 deletions

View File

@@ -3,6 +3,11 @@ import os
from faster_whisper import WhisperModel, decode_audio
def test_supported_languages():
model = WhisperModel("tiny.en")
assert model.supported_languages == ["en"]
def test_transcribe(jfk_path):
model = WhisperModel("tiny")
segments, info = model.transcribe(jfk_path, word_timestamps=True)