Skip to content

Commit 03c7f78

Browse files
committed
python3Packages.whisperx: init at 3.3.1
1 parent 332682c commit 03c7f78

File tree

3 files changed

+79
-0
lines changed

3 files changed

+79
-0
lines changed
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
diff --git a/whisperx/audio.py b/whisperx/audio.py
2+
index 42f97b8..672b7d0 100644
3+
--- a/whisperx/audio.py
4+
+++ b/whisperx/audio.py
5+
@@ -42,7 +42,7 @@ def load_audio(file: str, sr: int = SAMPLE_RATE) -> np.ndarray:
6+
# Launches a subprocess to decode audio while down-mixing and resampling as necessary.
7+
# Requires the ffmpeg CLI to be installed.
8+
cmd = [
9+
- "ffmpeg",
10+
+ "@ffmpeg@/bin/ffmpeg",
11+
"-nostdin",
12+
"-threads",
13+
"0",
Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
{
2+
lib,
3+
buildPythonPackage,
4+
fetchFromGitHub,
5+
6+
setuptools,
7+
replaceVars,
8+
9+
ctranslate2,
10+
faster-whisper,
11+
ffmpeg,
12+
nltk,
13+
pandas,
14+
pyannote-audio,
15+
torch,
16+
torchaudio,
17+
transformers,
18+
}:
19+
let
20+
pname = "whisperX";
21+
version = "3.3.1";
22+
in
23+
buildPythonPackage {
24+
inherit pname version;
25+
pyproject = true;
26+
27+
src = fetchFromGitHub {
28+
owner = "m-bain";
29+
repo = pname;
30+
tag = "v${version}";
31+
hash = "sha256-Wb9jKTs0rTdgjvcnKl1P8Uh6b5jzlkKgQBcJYA+7+W4=";
32+
};
33+
34+
build-system = [ setuptools ];
35+
36+
dependencies = [
37+
ctranslate2
38+
faster-whisper
39+
nltk
40+
pandas
41+
pyannote-audio
42+
torch
43+
torchaudio
44+
transformers
45+
];
46+
47+
pythonRelaxDeps = [ "ctranslate2" "faster-whisper" ];
48+
49+
pythonImportsCheck = [ "whisperx" ];
50+
51+
makeWrapperArgs = [ "--prefix PATH : ${lib.makeBinPath [ ffmpeg ] }" ];
52+
53+
# No tests LOL
54+
doCheck = false;
55+
56+
meta = {
57+
mainProgram = "whisperx";
58+
description = "Automatic Speech Recognition with Word-level Timestamps (& Diarization) ";
59+
60+
platforms = lib.platforms.all;
61+
license = lib.licenses.bsd2;
62+
maintainers = with lib.maintainers; [ bengsparks ];
63+
};
64+
}

pkgs/top-level/python-packages.nix

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18324,6 +18324,8 @@ self: super: with self; {
1832418324

1832518325
whispers = callPackage ../development/python-modules/whispers { };
1832618326

18327+
whisperx = callPackage ../development/python-modules/whisperx { };
18328+
1832718329
whitenoise = callPackage ../development/python-modules/whitenoise { };
1832818330

1832918331
whodap = callPackage ../development/python-modules/whodap { };

0 commit comments

Comments
 (0)