Add Dockerfile example (#828)
This commit is contained in:
8
docker/Dockerfile
Normal file
8
docker/Dockerfile
Normal file
@@ -0,0 +1,8 @@
|
||||
FROM nvidia/cuda:12.0.0-runtime-ubuntu20.04
|
||||
|
||||
WORKDIR /root
|
||||
RUN apt-get update -y && apt-get install -y python3 python3-pip libcudnn8 libcudnn8-dev
|
||||
COPY infer.py jfk.flac ./
|
||||
RUN pip3 install faster-whisper
|
||||
|
||||
ENTRYPOINT ["python3", "infer.py"]
|
||||
7
docker/infer.py
Normal file
7
docker/infer.py
Normal 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))
|
||||
BIN
docker/jfk.flac
Normal file
BIN
docker/jfk.flac
Normal file
Binary file not shown.
Reference in New Issue
Block a user