2024-06-05 15:53:02 +00:00
|
|
|
{
|
|
|
|
lib,
|
|
|
|
buildPythonPackage,
|
|
|
|
fetchFromGitHub,
|
2023-07-15 17:15:38 +00:00
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
# build-system
|
|
|
|
setuptools,
|
2024-04-21 15:54:59 +00:00
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
# dependencies
|
|
|
|
av,
|
|
|
|
ctranslate2,
|
|
|
|
huggingface-hub,
|
|
|
|
onnxruntime,
|
|
|
|
tokenizers,
|
2023-07-15 17:15:38 +00:00
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
# tests
|
|
|
|
pytestCheckHook,
|
2023-07-15 17:15:38 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "faster-whisper";
|
2024-07-27 06:49:29 +00:00
|
|
|
version = "1.0.3";
|
2024-04-21 15:54:59 +00:00
|
|
|
pyproject = true;
|
2023-07-15 17:15:38 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
2024-04-21 15:54:59 +00:00
|
|
|
owner = "SYSTRAN";
|
2023-07-15 17:15:38 +00:00
|
|
|
repo = "faster-whisper";
|
2024-04-21 15:54:59 +00:00
|
|
|
rev = "refs/tags/v${version}";
|
2024-07-27 06:49:29 +00:00
|
|
|
hash = "sha256-C/O+wt3dykQJmH+VsVkpQwEAdyW8goMUMKR0Z3Y7jdo=";
|
2023-07-15 17:15:38 +00:00
|
|
|
};
|
|
|
|
|
2024-04-21 15:54:59 +00:00
|
|
|
build-system = [
|
|
|
|
setuptools
|
2024-05-15 15:35:15 +00:00
|
|
|
];
|
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
pythonRelaxDeps = [ "tokenizers" ];
|
2024-04-21 15:54:59 +00:00
|
|
|
|
|
|
|
dependencies = [
|
2023-07-15 17:15:38 +00:00
|
|
|
av
|
|
|
|
ctranslate2
|
|
|
|
huggingface-hub
|
|
|
|
onnxruntime
|
|
|
|
tokenizers
|
|
|
|
];
|
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
pythonImportsCheck = [ "faster_whisper" ];
|
2023-07-15 17:15:38 +00:00
|
|
|
|
|
|
|
# all tests require downloads
|
|
|
|
doCheck = false;
|
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
nativeCheckInputs = [ pytestCheckHook ];
|
2023-07-15 17:15:38 +00:00
|
|
|
|
|
|
|
preCheck = ''
|
|
|
|
export HOME=$TMPDIR
|
|
|
|
'';
|
|
|
|
|
|
|
|
meta = with lib; {
|
2024-05-15 15:35:15 +00:00
|
|
|
changelog = "https://github.com/SYSTRAN/faster-whisper/releases/tag/v${version}";
|
2023-07-15 17:15:38 +00:00
|
|
|
description = "Faster Whisper transcription with CTranslate2";
|
2024-05-15 15:35:15 +00:00
|
|
|
homepage = "https://github.com/SYSTRAN/faster-whisper";
|
2023-07-15 17:15:38 +00:00
|
|
|
license = licenses.mit;
|
|
|
|
maintainers = with maintainers; [ hexa ];
|
|
|
|
};
|
|
|
|
}
|