Add Dockerfile example (#828)

This commit is contained in:
trungkienbkhn
2024-05-13 16:33:09 +07:00
committed by GitHub
parent 2f6913efc8
commit 2036d12634
3 changed files with 15 additions and 0 deletions

7
docker/infer.py Normal file
View File

@@ -0,0 +1,7 @@
from faster_whisper import WhisperModel
jfk_path = "jfk.flac"
model = WhisperModel("tiny", device="cuda")
segments, info = model.transcribe(jfk_path, word_timestamps=True)
for segment in segments:
print("[%.2fs -> %.2fs] %s" % (segment.start, segment.end, segment.text))