forked from m-bain/whisperX
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Smaller dockerfile * Small dockerfile no model * README no need for -- with new docker * Revert "README no need for -- with new docker" This reverts commit e9816fb2df019148e148e656381b44f1f044446d. --------- Co-authored-by: 陳鈞 <jim60105@gmail.com>
- Loading branch information
1 parent
e7c0181
commit e4e26d5
Showing
3 changed files
with
79 additions
and
34 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,31 +1,51 @@ | ||
FROM nvcr.io/nvidia/pytorch:23.05-py3 as base | ||
ARG TORCH_HOME=/cache/torch | ||
ARG HF_HOME=/cache/huggingface | ||
|
||
WORKDIR /app | ||
ENV TORCH_HOME=/cache/torch | ||
ENV HF_HOME=/cache/huggingface | ||
|
||
# ffmpeg | ||
COPY --link --from=mwader/static-ffmpeg:6.0 /ffmpeg /usr/local/bin/ | ||
COPY --link --from=mwader/static-ffmpeg:6.0 /ffprobe /usr/local/bin/ | ||
FROM python:3.10-slim as dependencies | ||
|
||
# Setup venv | ||
RUN python3 -m venv /venv | ||
ARG PATH="/venv/bin:$PATH" | ||
RUN python3 -m pip install --upgrade pip setuptools | ||
# Install requirements | ||
COPY ./whisperX/requirements.txt . | ||
RUN python3 -m pip install --no-cache-dir -r ./requirements.txt ujson torch==2.0.1 torchvision==0.15.2 torchaudio==2.0.2 | ||
RUN python3 -m pip install torch torchaudio --extra-index-url https://download.pytorch.org/whl/cu118 | ||
|
||
FROM base AS final | ||
# Add git | ||
ARG DEBIAN_FRONTEND=noninteractive | ||
RUN apt-get update && apt-get install -y --no-install-recommends git | ||
|
||
# Install whisperX | ||
COPY ./whisperX/ . | ||
RUN python3 -m pip install --no-cache-dir . | ||
COPY ./whisperX /code | ||
RUN python3 -m pip install /code | ||
|
||
|
||
FROM python:3.10-slim | ||
|
||
# Copy and use venv | ||
COPY --from=dependencies /venv /venv | ||
ARG PATH="/venv/bin:$PATH" | ||
ENV PATH=${PATH} | ||
|
||
# Non-root user | ||
RUN useradd -m -s /bin/bash appuser \ | ||
&& mkdir -p /cache \ | ||
&& chown -R appuser:appuser /cache | ||
USER appuser | ||
|
||
ENV WHISPER_MODEL= | ||
ENV LANG= | ||
WORKDIR /app | ||
ARG TORCH_HOME | ||
ARG HF_HOME | ||
ENV TORCH_HOME=${TORCH_HOME} | ||
ENV HF_HOME=${HF_HOME} | ||
|
||
# ffmpeg | ||
COPY --link --from=mwader/static-ffmpeg:6.0 /ffmpeg /usr/local/bin/ | ||
COPY --link --from=mwader/static-ffmpeg:6.0 /ffprobe /usr/local/bin/ | ||
|
||
ARG WHISPER_MODEL | ||
ENV WHISPER_MODEL=${WHISPER_MODEL} | ||
ARG LANG | ||
ENV LANG=${LANG} | ||
|
||
STOPSIGNAL SIGINT | ||
ENTRYPOINT whisperx $* | ||
ENTRYPOINT whisperx $@ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters