diff --git a/pkgs/by-name/wh/whisperx/package.nix b/pkgs/by-name/wh/whisperx/package.nix new file mode 100644 index 00000000000000..7e7d672a4658ac --- /dev/null +++ b/pkgs/by-name/wh/whisperx/package.nix @@ -0,0 +1 @@ +{ pkgs }: with pkgs.python3Packages; toPythonApplication whisperx diff --git a/pkgs/development/python-modules/whisperx/default.nix b/pkgs/development/python-modules/whisperx/default.nix new file mode 100644 index 00000000000000..c903f190c3ea3c --- /dev/null +++ b/pkgs/development/python-modules/whisperx/default.nix @@ -0,0 +1,63 @@ +{ + lib, + buildPythonPackage, + fetchFromGitHub, + + setuptools, + + ctranslate2, + faster-whisper, + ffmpeg, + nltk, + pandas, + pyannote-audio, + torch, + torchaudio, + transformers, +}: +buildPythonPackage rec { + pname = "whisperx"; + version = "3.3.1"; + pyproject = true; + + src = fetchFromGitHub { + owner = "m-bain"; + repo = "whisperX"; + tag = "v${version}"; + hash = "sha256-Wb9jKTs0rTdgjvcnKl1P8Uh6b5jzlkKgQBcJYA+7+W4="; + }; + + build-system = [ setuptools ]; + + dependencies = [ + ctranslate2 + faster-whisper + nltk + pandas + pyannote-audio + torch + torchaudio + transformers + ]; + + pythonRelaxDeps = [ + "ctranslate2" + "faster-whisper" + ]; + + pythonImportsCheck = [ "whisperx" ]; + + # No tests in repository + doCheck = false; + + makeWrapperArgs = [ "--prefix PATH : ${lib.makeBinPath [ ffmpeg ]}" ]; + + meta = { + mainProgram = "whisperx"; + description = "Automatic Speech Recognition with Word-level Timestamps (& Diarization) "; + + platforms = lib.platforms.all; + license = lib.licenses.bsd2; + maintainers = with lib.maintainers; [ bengsparks ]; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 2c30a1d273f975..2c0e9d01017851 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -18324,6 +18324,8 @@ self: super: with self; { whispers = callPackage ../development/python-modules/whispers { }; + whisperx = callPackage ../development/python-modules/whisperx { }; + whitenoise = callPackage ../development/python-modules/whitenoise { }; whodap = callPackage ../development/python-modules/whodap { };