2022-09-30 11:47:45 +00:00
|
|
|
{ lib
|
|
|
|
, fetchFromGitHub
|
|
|
|
, buildPythonPackage
|
2022-10-06 18:32:54 +00:00
|
|
|
, substituteAll
|
2024-01-02 11:29:13 +00:00
|
|
|
|
|
|
|
# build-system
|
|
|
|
, setuptools
|
2022-10-06 18:32:54 +00:00
|
|
|
|
|
|
|
# runtime
|
2023-10-09 19:29:22 +00:00
|
|
|
, ffmpeg-headless
|
2022-09-30 11:47:45 +00:00
|
|
|
|
|
|
|
# propagates
|
|
|
|
, more-itertools
|
2023-04-12 12:48:02 +00:00
|
|
|
, numba
|
2024-01-02 11:29:13 +00:00
|
|
|
, numpy
|
2023-04-12 12:48:02 +00:00
|
|
|
, openai-triton
|
|
|
|
, scipy
|
|
|
|
, tiktoken
|
2024-01-02 11:29:13 +00:00
|
|
|
, torch
|
|
|
|
, tqdm
|
|
|
|
, transformers
|
2022-09-30 11:47:45 +00:00
|
|
|
|
|
|
|
# tests
|
|
|
|
, pytestCheckHook
|
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "whisper";
|
2024-01-02 11:29:13 +00:00
|
|
|
version = "20231117";
|
|
|
|
pyproject = true;
|
2022-09-30 11:47:45 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "openai";
|
|
|
|
repo = pname;
|
2023-02-02 18:25:31 +00:00
|
|
|
rev = "refs/tags/v${version}";
|
2024-01-02 11:29:13 +00:00
|
|
|
hash = "sha256-MJ1XjB/GuYUiECCuuHS0NWHvvs+ko0oTvLuDI7zLNiY=";
|
2022-09-30 11:47:45 +00:00
|
|
|
};
|
|
|
|
|
2022-10-06 18:32:54 +00:00
|
|
|
patches = [
|
|
|
|
(substituteAll {
|
|
|
|
src = ./ffmpeg-path.patch;
|
2023-10-09 19:29:22 +00:00
|
|
|
ffmpeg = ffmpeg-headless;
|
2022-10-06 18:32:54 +00:00
|
|
|
})
|
|
|
|
];
|
2022-09-30 11:47:45 +00:00
|
|
|
|
2024-01-02 11:29:13 +00:00
|
|
|
nativeBuildInputs = [
|
|
|
|
setuptools
|
|
|
|
];
|
|
|
|
|
2022-09-30 11:47:45 +00:00
|
|
|
propagatedBuildInputs = [
|
|
|
|
more-itertools
|
2023-04-12 12:48:02 +00:00
|
|
|
numba
|
2024-01-02 11:29:13 +00:00
|
|
|
numpy
|
|
|
|
openai-triton
|
2023-04-12 12:48:02 +00:00
|
|
|
scipy
|
|
|
|
tiktoken
|
|
|
|
torch
|
2024-01-02 11:29:13 +00:00
|
|
|
tqdm
|
|
|
|
transformers
|
2022-09-30 11:47:45 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
preCheck = ''
|
|
|
|
export HOME=$TMPDIR
|
|
|
|
'';
|
|
|
|
|
2023-02-02 18:25:31 +00:00
|
|
|
nativeCheckInputs = [
|
2022-09-30 11:47:45 +00:00
|
|
|
pytestCheckHook
|
|
|
|
];
|
|
|
|
|
|
|
|
disabledTests = [
|
|
|
|
# requires network access to download models
|
|
|
|
"test_transcribe"
|
2023-04-12 12:48:02 +00:00
|
|
|
# requires NVIDIA drivers
|
|
|
|
"test_dtw_cuda_equivalence"
|
|
|
|
"test_median_filter_equivalence"
|
2022-09-30 11:47:45 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
meta = with lib; {
|
2024-01-02 11:29:13 +00:00
|
|
|
changelog = "https://github.com/openai/whisper/blob/v${version}/CHANGELOG.md";
|
2022-09-30 11:47:45 +00:00
|
|
|
description = "General-purpose speech recognition model";
|
2024-04-21 15:54:59 +00:00
|
|
|
mainProgram = "whisper";
|
2022-09-30 11:47:45 +00:00
|
|
|
homepage = "https://github.com/openai/whisper";
|
|
|
|
license = licenses.mit;
|
2023-04-12 12:48:02 +00:00
|
|
|
maintainers = with maintainers; [ hexa MayNiklas ];
|
2022-09-30 11:47:45 +00:00
|
|
|
};
|
|
|
|
}
|