Skip to content

Commit

Permalink
Ability to align multiple languages added, i.e. LAND="pl fr en"
Browse files Browse the repository at this point in the history
  • Loading branch information
bugsyb authored and jim60105 committed Nov 30, 2023
1 parent 139f0eb commit 5ad0930
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
4 changes: 3 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,9 @@ RUN python3 -c 'import faster_whisper; model = faster_whisper.WhisperModel("'${W
# Preload align model
ARG LANG
COPY load_align_model.py .
RUN python3 load_align_model.py ${LANG}

# Aligining language(s) as provided)
RUN for i in ${LANG}; do echo "Aliging lang $i"; python3 load_align_model.py $i; done


FROM python:3.10-slim
Expand Down
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,9 @@ docker run --gpus all -it -v ".:/app" ghcr.io/jim60105/whisperx:large-v3-ja -- -
docker run --gpus all -it -v ".:/app" ghcr.io/jim60105/whisperx:no_model -- --model tiny --language en --output_format srt audio.mp3
```

In case of multiple language alignments needed, use space separated list of languages"LANG=pl fr en" when building the image.


The image tags are formatted as `WHISPER_MODEL`-`LANG`, for example, `tiny-en`, `base-de`, or `large-v3-zh`.\
Please be aware that the whisper models `*.en` and `large-v1` have been excluded as I believe they are not frequently used. If you require these models, please refer to the following section to build them on your own.

Expand Down Expand Up @@ -66,6 +69,9 @@ The [Dockerfile](https://github.com/jim60105/docker-whisperX/blob/master/Dockerf

- `WHISPER_MODEL`: The model name. The default is `base`. See [fast-whisper](https://huggingface.co/guillaumekln) for supported models.

In case of multiple language alignments needed, use space separated list of languages `"LANG=pl fr en"` when building the image. Worth adding it when tagging image too, i.e. -t local/whisperx:large-v3-pl-fr-en


### Build Command

For example, if you want to build the image with `en` language and `large-v3` model:
Expand Down

0 comments on commit 5ad0930

Please sign in to comment.