{"id":13573905,"url":"https://github.com/jim60105/docker-whisperX","last_synced_at":"2025-04-04T13:30:26.971Z","repository":{"id":191013512,"uuid":"683385017","full_name":"jim60105/docker-whisperX","owner":"jim60105","description":"Dockerfile for WhisperX: Automatic Speech Recognition with Word-Level Timestamps and Speaker Diarization (Dockerfile, CI image build and test)","archived":false,"fork":false,"pushed_at":"2025-03-30T16:55:41.000Z","size":373,"stargazers_count":252,"open_issues_count":2,"forks_count":32,"subscribers_count":6,"default_branch":"master","last_synced_at":"2025-04-04T00:07:07.799Z","etag":null,"topics":["asr","docker-image","dockerfile","speech","speech-recognition","speech-to-text","whisper"],"latest_commit_sha":null,"homepage":"","language":"Dockerfile","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jim60105.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-08-26T11:59:17.000Z","updated_at":"2025-04-01T04:24:33.000Z","dependencies_parsed_at":"2023-09-26T02:03:44.166Z","dependency_job_id":"3a9668ce-4c09-4a4b-ab07-a450fd2acb80","html_url":"https://github.com/jim60105/docker-whisperX","commit_stats":null,"previous_names":["jim60105/docker-whisperx"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jim60105%2Fdocker-whisperX","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jim60105%2Fdocker-whisperX/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jim60105%2Fdocker-whisperX/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jim60105%2Fdocker-whisperX/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jim60105","download_url":"https://codeload.github.com/jim60105/docker-whisperX/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247184851,"owners_count":20897843,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["asr","docker-image","dockerfile","speech","speech-recognition","speech-to-text","whisper"],"created_at":"2024-08-01T15:00:43.162Z","updated_at":"2025-04-04T13:30:26.965Z","avatar_url":"https://github.com/jim60105.png","language":"Dockerfile","funding_links":[],"categories":["Dockerfile"],"sub_categories":[],"readme":"# docker-whisperX\n\n[![CodeFactor](https://www.codefactor.io/repository/github/jim60105/docker-whisperx/badge)](https://www.codefactor.io/repository/github/jim60105/docker-whisperx) ![Docker Build](https://img.shields.io/github/actions/workflow/status/jim60105/docker-whisperX/docker_publish.yml?label=Docker%20Build) [![Image Scan](https://img.shields.io/github/actions/workflow/status/jim60105/docker-whisperX/scan.yml?label=Image%20Scan)](https://github.com/jim60105/docker-whisperX/actions/workflows/scan.yml) [![Image Scan UBI](https://img.shields.io/github/actions/workflow/status/jim60105/docker-whisperX/scan_ubi.yml?label=Image%20Scan%20UBI)](https://github.com/jim60105/docker-whisperX/actions/workflows/scan_ubi.yml)\n\nThis is the docker image for [WhisperX: Automatic Speech Recognition with Word-Level Timestamps (and Speaker Diarization)](https://github.com/m-bain/whisperX) from the community.\n\nThe objective of this project is to efficiently manage the continuous integration docker build workflow on the ***GitHub Free runner*** on a ***weekly basis***. Which includes building ***175*** Docker images ***in parallel***, each with a size of ***10GB.*** To ensure smooth operation, I have concentrated on utilizing docker layer caches efficiently, maximizing layer reuse, carefully managing cache read/write order to prevent any issues, and optimizing to minimize image size and build time.\n\nAdditionally, for my personal preference, I am dedicated to following best practices, industry standards and policies to the best of my ability.\n\nGet the Dockerfile at [GitHub](https://github.com/jim60105/docker-whisperX), or pull the image from [ghcr.io](https://ghcr.io/jim60105/whisperx).\n\n## 🚀 Get your Docker ready for GPU support\n\n### Windows\n\nOnce you have installed **Docker Desktop**, **CUDA Toolkit**, **NVIDIA Windows Driver**, and ensured that your Docker is running with **WSL2**, you are ready to go.\n\nHere is the official documentation for further reference.  \n\u003chttps://docs.nvidia.com/cuda/wsl-user-guide/index.html#nvidia-compute-software-support-on-wsl-2\u003e\n\u003chttps://docs.docker.com/desktop/wsl/use-wsl/#gpu-support\u003e\n\n### Linux, OSX\n\nInstall an NVIDIA GPU Driver if you do not already have one installed.  \n\u003chttps://docs.nvidia.com/datacenter/tesla/tesla-installation-notes/index.html\u003e\n\nInstall the NVIDIA Container Toolkit with this guide.  \n\u003chttps://docs.nvidia.com/datacenter/cloud-native/container-toolkit/latest/install-guide.html\u003e\n\n## 📦 Available Pre-built Image\n\n![GitHub Workflow Status (with event)](https://img.shields.io/github/actions/workflow/status/jim60105/docker-whisperX/docker_publish.yml?label=Docker%20Build) ![GitHub last commit (branch)](https://img.shields.io/github/last-commit/jim60105/docker-whisperX/master?label=Date)\n\n\u003e [!NOTE]  \n\u003e The WhisperX code base in these images aligns with the git submodule commit hash.  \n\u003e I have [a scheduled CI workflow](https://github.com/jim60105/docker-whisperX/actions/workflows/submodule_update.yml) runs weekly to target on [the main branch](https://github.com/m-bain/whisperX/tree/main) and rebuild all docker images.\n\n```bash\ndocker run --gpus all -it -v \".:/app\" ghcr.io/jim60105/whisperx:base-en     -- --output_format srt audio.mp3\ndocker run --gpus all -it -v \".:/app\" ghcr.io/jim60105/whisperx:large-v3-ja -- --output_format srt audio.mp3\ndocker run --gpus all -it -v \".:/app\" ghcr.io/jim60105/whisperx:no_model    -- --model tiny --language en --output_format srt audio.mp3\n```\n\nThe image tags are formatted as `WHISPER_MODEL`-`LANG`, for example, `tiny-en`, `base-de` or `large-v3-zh`.  \nPlease be aware that the whisper models `*.en`,  `large-v1`, `large-v2` 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.\n\nYou can find the actual build matrix in [docker_publish.yml](.github/workflows/docker_publish.yml#L212) and all available tags at [ghcr.io](https://github.com/jim60105/docker-whisperX/pkgs/container/whisperx/versions?filters%5Bversion_type%5D=tagged).\n\nIn addition, there is also a `no_model` tag that does not include any pre-downloaded models, also referred to as `latest`.\n\n\u003e Added a `distil-large-v3-en` model.  \n\u003e Only en, distil model seems to only support English.\n\n## ⚡️ Preserve the download cache for the align models when working with various languages\n\nYou can mount the `/.cache` to share align models between containers.  \nPlease use tag `no_model` (`latest`) for this scenario.\n\n```bash\ndocker run --gpus all -it -v \".:/app\" -v whisper_cache:/.cache ghcr.io/jim60105/whisperx:latest -- --model large-v3 --language en --output_format srt audio.mp3\n```\n\n## 🛠️ Building the Docker Image\n\n\u003e [!IMPORTANT]  \n\u003e Clone the Git repository recursively to include submodules:  \n\u003e `git clone --recursive https://github.com/jim60105/docker-whisperX.git`\n\n### Build Arguments\n\nThe [Dockerfile](Dockerfile) builds the image contained models. It accepts two build arguments: `LANG` and `WHISPER_MODEL`.\n\n- `LANG`: The language to transcribe. The default is `en`. See [here](https://github.com/jim60105/docker-whisperX/blob/master/load_align_model.py) for supported languages.\n- `WHISPER_MODEL`: The model name. The default is `base`. See [fast-whisper](https://huggingface.co/Systran) for supported models.\n\nIn case of multiple language alignments needed, use space separated list of languages `\"LANG=pl fr en\"` when building the image. Also note that WhisperX is not doing well to handle multiple languages within the same audio file. Even if you do not provide the language parameter, it will still recognize the language (or fallback to en) and use it for choosing the alignment model. Alignment models are language specific. **This instruction is simply for embedding multiple alignment models into a docker image.**\n\n### Build Command\n\n\u003e [!NOTE]  \n\u003e If you are using an earlier version of the docker client, it is necessary to [enable the BuildKit mode](https://docs.docker.com/build/buildkit/#getting-started) when building the image. This is because I used the `COPY --link` feature which enhances the build performance and was introduced in Buildx v0.8.  \n\u003e With the Docker Engine 23.0 and Docker Desktop 4.19, Buildx has become the default build client. So you won't have to worry about this when using the latest version.\n\nFor example, if you want to build the image with `en` language and `large-v3` model:\n\n```bash\ndocker build --build-arg LANG=en --build-arg WHISPER_MODEL=large-v3 -t whisperx:large-v3-en .\n```\n\nIf you want to build the image without any pre-downloaded models:\n\n```bash\ndocker build --target no_model -t whisperx:no_model .\n```\n\nIf you want to build all images at once, we have [a Docker bake file](docker-bake.hcl) available:\n\n\u003e [!WARNING]  \n\u003e [Bake](https://docs.docker.com/build/bake/) is currently an experimental feature, and it may require additional configuration in order to function correctly.\n\n```bash\ndocker buildx bake build no_model ubi-no_model\n```\n\n### Usage Command\n\nMount the current directory as `/app` and run WhisperX with additional input arguments:\n\n```bash\ndocker run --gpus all -it -v \".:/app\" whisperx:large-v3-ja -- --output_format srt audio.mp3\n```\n\n\u003e [!NOTE]  \n\u003e Remember to prepend `--` before the arguments.  \n\u003e `--model` and `--language` args are defined in Dockerfile, no need to specify.\n\n## ⛑️ Red Hat UBI based Image\n\n[![Image Scan UBI](https://img.shields.io/github/actions/workflow/status/jim60105/docker-whisperX/scan_ubi.yml?label=Image%20Scan%20UBI)](https://github.com/jim60105/docker-whisperX/actions/workflows/scan_ubi.yml)\n\nI have created an alternative [ubi.Dockerfile](ubi.Dockerfile) that is based on the **Red Hat Universal Base Image (UBI)** image, unlike the default one which used the **Python official image** as the base image. If you are a Red Hat subscriber, I believe you will find its benefits.\n\n\u003e [!TIP]\n\u003e With the release of the Red Hat Universal Base Image (UBI), you can now take advantage of the greater reliability, security, and performance of official Red Hat container images where OCI-compliant Linux containers run - whether you're a customer or not. -- [Red Hat blog](https://www.redhat.com/en/blog/introducing-red-hat-universal-base-image)\n\nIt is important to mention that it is *NOT* necessary obtaining a license from Red Hat to use UBI, however, if you are the subscriber and runs it on RHEL/OpenShift, you may get supports from Red Hat.\n\nDespite my initial hesitation, I made the decision not to utilize the *UBI* version as the default image. The *Python official image* has a significantly larger user base compared to *UBI*, and I believe that opting for it aligns better with public expectations. Nevertheless, I would still suggest giving the *UBI* version a try.\n\nPlease refer to [the latest vulnerability scan report](https://github.com/jim60105/docker-whisperX/actions/workflows/scan.yml?query=is%3Asuccess) from our scanning workflow artifact. You can see that the *UBI* version has fewer vulnerabilities compared to the *Python official image* version.\n\nYou can get the pre-built image at tag `ubi-no_model`. Notice that only `no_model` is available. Feel free to build your own image with the [ubi.Dockerfile](ubi.Dockerfile) for your needs. This Dockerfile supports the same build arguments as the default one.\n\n```bash\ndocker run --gpus all -it -v \".:/app\" ghcr.io/jim60105/whisperx:ubi-no_model -- --model tiny --language en --output_format srt audio.mp3\n```\n\n\u003e [!WARNING]\n\u003e ***DISCLAIMER***:  \n\u003e I have created the image in accordance with the specifications outlined in the [Red Hat Container Certification Requirement](https://access.redhat.com/documentation/en-us/red_hat_software_certification/8.72/html/red_hat_openshift_software_certification_policy_guide/assembly-requirements-for-container-images_openshift-sw-cert-policy-introduction) but I am not going to pursue the actual [certification](https://connect.redhat.com/en/partner-with-us/red-hat-container-certification).\n\n## 📝 LICENSE\n\n\u003e The main program, WhisperX, is distributed under [the BSD-4 license](https://github.com/m-bain/whisperX/blob/main/LICENSE).  \n\u003e Please consult their repository for access to the source code and license.\n\nThe Dockerfile and CI workflow files in this repository are licensed under [the MIT license](LICENSE).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjim60105%2Fdocker-whisperX","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjim60105%2Fdocker-whisperX","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjim60105%2Fdocker-whisperX/lists"}