4542cc7e33
The repository moved out of the openai org, so it doesn't make sense to prefix the package with it. (cherry picked from commit af13bb4513647eec3c3790c5272dbd4aa190d208)
87 lines
1.5 KiB
Nix
87 lines
1.5 KiB
Nix
{
|
|
lib,
|
|
stdenv,
|
|
fetchFromGitHub,
|
|
buildPythonPackage,
|
|
substituteAll,
|
|
|
|
# build-system
|
|
setuptools,
|
|
|
|
# runtime
|
|
ffmpeg-headless,
|
|
|
|
# propagates
|
|
more-itertools,
|
|
numba,
|
|
numpy,
|
|
triton,
|
|
tiktoken,
|
|
torch,
|
|
tqdm,
|
|
|
|
# tests
|
|
pytestCheckHook,
|
|
scipy,
|
|
}:
|
|
|
|
buildPythonPackage rec {
|
|
pname = "whisper";
|
|
version = "20231117";
|
|
pyproject = true;
|
|
|
|
src = fetchFromGitHub {
|
|
owner = "openai";
|
|
repo = pname;
|
|
rev = "refs/tags/v${version}";
|
|
hash = "sha256-MJ1XjB/GuYUiECCuuHS0NWHvvs+ko0oTvLuDI7zLNiY=";
|
|
};
|
|
|
|
patches = [
|
|
(substituteAll {
|
|
src = ./ffmpeg-path.patch;
|
|
ffmpeg = ffmpeg-headless;
|
|
})
|
|
];
|
|
|
|
nativeBuildInputs = [ setuptools ];
|
|
|
|
propagatedBuildInputs = [
|
|
more-itertools
|
|
numba
|
|
numpy
|
|
tiktoken
|
|
torch
|
|
tqdm
|
|
] ++ lib.optionals (lib.meta.availableOn stdenv.hostPlatform triton) [ triton ];
|
|
|
|
preCheck = ''
|
|
export HOME=$TMPDIR
|
|
'';
|
|
|
|
nativeCheckInputs = [
|
|
pytestCheckHook
|
|
scipy
|
|
];
|
|
|
|
disabledTests = [
|
|
# requires network access to download models
|
|
"test_transcribe"
|
|
# requires NVIDIA drivers
|
|
"test_dtw_cuda_equivalence"
|
|
"test_median_filter_equivalence"
|
|
];
|
|
|
|
meta = with lib; {
|
|
changelog = "https://github.com/openai/whisper/blob/v${version}/CHANGELOG.md";
|
|
description = "General-purpose speech recognition model";
|
|
mainProgram = "whisper";
|
|
homepage = "https://github.com/openai/whisper";
|
|
license = licenses.mit;
|
|
maintainers = with maintainers; [
|
|
hexa
|
|
MayNiklas
|
|
];
|
|
};
|
|
}
|