a0cb138ada
GitOrigin-RevId: a100acd7bbf105915b0004427802286c37738fef
69 lines
1.1 KiB
Nix
69 lines
1.1 KiB
Nix
{ lib
|
|
, fetchFromGitHub
|
|
, buildPythonPackage
|
|
, substituteAll
|
|
|
|
# runtime
|
|
, ffmpeg
|
|
|
|
# propagates
|
|
, numpy
|
|
, torch
|
|
, tqdm
|
|
, more-itertools
|
|
, transformers
|
|
, ffmpeg-python
|
|
|
|
# tests
|
|
, pytestCheckHook
|
|
}:
|
|
|
|
buildPythonPackage rec {
|
|
pname = "whisper";
|
|
version = "20230124";
|
|
format = "setuptools";
|
|
|
|
src = fetchFromGitHub {
|
|
owner = "openai";
|
|
repo = pname;
|
|
rev = "refs/tags/v${version}";
|
|
hash = "sha256-+3fs/EXK5NGlISuMTk7r2ZZ4tNFKbNFNkVS2LmHBvwk=";
|
|
};
|
|
|
|
patches = [
|
|
(substituteAll {
|
|
src = ./ffmpeg-path.patch;
|
|
inherit ffmpeg;
|
|
})
|
|
];
|
|
|
|
propagatedBuildInputs = [
|
|
numpy
|
|
torch
|
|
tqdm
|
|
more-itertools
|
|
transformers
|
|
ffmpeg-python
|
|
];
|
|
|
|
preCheck = ''
|
|
export HOME=$TMPDIR
|
|
'';
|
|
|
|
nativeCheckInputs = [
|
|
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 ];
|
|
};
|
|
}
|
|
|