504525a148
GitOrigin-RevId: bd645e8668ec6612439a9ee7e71f7eac4099d4f6
85 lines
1.4 KiB
Nix
85 lines
1.4 KiB
Nix
{ lib
|
|
, fetchFromGitHub
|
|
, buildPythonPackage
|
|
, substituteAll
|
|
|
|
# build-system
|
|
, setuptools
|
|
|
|
# runtime
|
|
, ffmpeg-headless
|
|
|
|
# propagates
|
|
, more-itertools
|
|
, numba
|
|
, numpy
|
|
, openai-triton
|
|
, scipy
|
|
, tiktoken
|
|
, torch
|
|
, tqdm
|
|
, transformers
|
|
|
|
# tests
|
|
, pytestCheckHook
|
|
}:
|
|
|
|
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
|
|
openai-triton
|
|
scipy
|
|
tiktoken
|
|
torch
|
|
tqdm
|
|
transformers
|
|
];
|
|
|
|
preCheck = ''
|
|
export HOME=$TMPDIR
|
|
'';
|
|
|
|
nativeCheckInputs = [
|
|
pytestCheckHook
|
|
];
|
|
|
|
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";
|
|
homepage = "https://github.com/openai/whisper";
|
|
license = licenses.mit;
|
|
maintainers = with maintainers; [ hexa MayNiklas ];
|
|
};
|
|
}
|