2022-09-22 07:08:04 +00:00
|
|
|
{ lib
|
|
|
|
, fetchFromGitHub
|
|
|
|
, buildPythonPackage
|
2022-09-30 13:09:56 +00:00
|
|
|
, substituteAll
|
|
|
|
|
|
|
|
# runtime
|
|
|
|
, ffmpeg
|
2022-09-22 07:08:04 +00:00
|
|
|
|
|
|
|
# propagates
|
|
|
|
, numpy
|
|
|
|
, torch
|
|
|
|
, tqdm
|
|
|
|
, more-itertools
|
|
|
|
, transformers
|
|
|
|
, ffmpeg-python
|
|
|
|
|
|
|
|
# tests
|
|
|
|
, pytestCheckHook
|
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "whisper";
|
2023-01-24 20:23:45 +00:00
|
|
|
version = "20230124";
|
2022-09-22 07:08:04 +00:00
|
|
|
format = "setuptools";
|
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "openai";
|
|
|
|
repo = pname;
|
2023-01-18 01:00:06 +00:00
|
|
|
rev = "refs/tags/v${version}";
|
2023-01-24 20:23:45 +00:00
|
|
|
hash = "sha256-+3fs/EXK5NGlISuMTk7r2ZZ4tNFKbNFNkVS2LmHBvwk=";
|
2022-09-22 07:08:04 +00:00
|
|
|
};
|
|
|
|
|
2022-09-30 13:09:56 +00:00
|
|
|
patches = [
|
|
|
|
(substituteAll {
|
|
|
|
src = ./ffmpeg-path.patch;
|
|
|
|
inherit ffmpeg;
|
|
|
|
})
|
|
|
|
];
|
2022-09-22 07:08:04 +00:00
|
|
|
|
|
|
|
propagatedBuildInputs = [
|
|
|
|
numpy
|
|
|
|
torch
|
|
|
|
tqdm
|
|
|
|
more-itertools
|
|
|
|
transformers
|
|
|
|
ffmpeg-python
|
|
|
|
];
|
|
|
|
|
|
|
|
preCheck = ''
|
|
|
|
export HOME=$TMPDIR
|
|
|
|
'';
|
|
|
|
|
2023-01-21 12:00:00 +00:00
|
|
|
nativeCheckInputs = [
|
2022-09-22 07:08:04 +00:00
|
|
|
pytestCheckHook
|
|
|
|
];
|
|
|
|
|
|
|
|
disabledTests = [
|
|
|
|
# requires network access to download models
|
|
|
|
"test_transcribe"
|
|
|
|
];
|
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "General-purpose speech recognition model";
|
|
|
|
homepage = "https://github.com/openai/whisper";
|
|
|
|
license = licenses.mit;
|
|
|
|
maintainers = with maintainers; [ hexa ];
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|