-
-
Notifications
You must be signed in to change notification settings - Fork 15k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
python3Packages.whisperx: init at 3.3.1
- Loading branch information
Benjamin Sparks
committed
Feb 18, 2025
1 parent
332682c
commit 03c7f78
Showing
3 changed files
with
79 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
diff --git a/whisperx/audio.py b/whisperx/audio.py | ||
index 42f97b8..672b7d0 100644 | ||
--- a/whisperx/audio.py | ||
+++ b/whisperx/audio.py | ||
@@ -42,7 +42,7 @@ def load_audio(file: str, sr: int = SAMPLE_RATE) -> np.ndarray: | ||
# Launches a subprocess to decode audio while down-mixing and resampling as necessary. | ||
# Requires the ffmpeg CLI to be installed. | ||
cmd = [ | ||
- "ffmpeg", | ||
+ "@ffmpeg@/bin/ffmpeg", | ||
"-nostdin", | ||
"-threads", | ||
"0", |
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 |
---|---|---|
@@ -0,0 +1,64 @@ | ||
{ | ||
lib, | ||
buildPythonPackage, | ||
fetchFromGitHub, | ||
|
||
setuptools, | ||
replaceVars, | ||
|
||
ctranslate2, | ||
faster-whisper, | ||
ffmpeg, | ||
nltk, | ||
pandas, | ||
pyannote-audio, | ||
torch, | ||
torchaudio, | ||
transformers, | ||
}: | ||
let | ||
pname = "whisperX"; | ||
version = "3.3.1"; | ||
in | ||
buildPythonPackage { | ||
inherit pname version; | ||
pyproject = true; | ||
|
||
src = fetchFromGitHub { | ||
owner = "m-bain"; | ||
repo = pname; | ||
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" ]; | ||
|
||
makeWrapperArgs = [ "--prefix PATH : ${lib.makeBinPath [ ffmpeg ] }" ]; | ||
|
||
# No tests LOL | ||
doCheck = false; | ||
|
||
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 ]; | ||
}; | ||
} |
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