2022-09-30 11:47:45 +00:00
|
|
|
{ lib
|
|
|
|
, fetchFromGitHub
|
|
|
|
, buildPythonPackage
|
2022-10-06 18:32:54 +00:00
|
|
|
, substituteAll
|
|
|
|
|
|
|
|
# runtime
|
|
|
|
, ffmpeg
|
2022-09-30 11:47:45 +00:00
|
|
|
|
|
|
|
# propagates
|
|
|
|
, numpy
|
|
|
|
, torch
|
|
|
|
, tqdm
|
|
|
|
, more-itertools
|
|
|
|
, transformers
|
|
|
|
, ffmpeg-python
|
|
|
|
|
|
|
|
# tests
|
|
|
|
, pytestCheckHook
|
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "whisper";
|
2022-10-06 18:32:54 +00:00
|
|
|
version = "unstable-2022-09-30";
|
2022-09-30 11:47:45 +00:00
|
|
|
format = "setuptools";
|
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "openai";
|
|
|
|
repo = pname;
|
2022-10-06 18:32:54 +00:00
|
|
|
rev = "60132ade70e00b843d93542fcb37b58c0d8bf9e7";
|
|
|
|
hash = "sha256-4mhlCvewA0bVo5bq2sbSEKHq99TQ6jUauiCUkdRSdas=";
|
2022-09-30 11:47:45 +00:00
|
|
|
};
|
|
|
|
|
2022-10-06 18:32:54 +00:00
|
|
|
patches = [
|
|
|
|
(substituteAll {
|
|
|
|
src = ./ffmpeg-path.patch;
|
|
|
|
inherit ffmpeg;
|
|
|
|
})
|
|
|
|
];
|
2022-09-30 11:47:45 +00:00
|
|
|
|
|
|
|
propagatedBuildInputs = [
|
|
|
|
numpy
|
|
|
|
torch
|
|
|
|
tqdm
|
|
|
|
more-itertools
|
|
|
|
transformers
|
|
|
|
ffmpeg-python
|
|
|
|
];
|
|
|
|
|
|
|
|
preCheck = ''
|
|
|
|
export HOME=$TMPDIR
|
|
|
|
'';
|
|
|
|
|
|
|
|
checkInputs = [
|
|
|
|
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 ];
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|