nixpkgs/pkgs/tools/audio/whisper-ctranslate2/default.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

56 lines
1.3 KiB
Nix
Raw Normal View History

2023-07-03 13:31:37 +01:00
{ lib
2023-10-08 16:10:19 +01:00
, python3
2023-07-03 13:31:37 +01:00
, fetchFromGitHub
, nix-update-script
}:
let
pname = "whisper-ctranslate2";
2024-07-04 09:28:30 +01:00
version = "0.4.5";
2023-07-03 13:31:37 +01:00
in
python3.pkgs.buildPythonApplication {
inherit pname version;
pyproject = true;
2023-07-03 13:31:37 +01:00
disabled = python3.pythonOlder "3.6";
src = fetchFromGitHub {
owner = "Softcatala";
2023-10-08 16:10:19 +01:00
repo = "whisper-ctranslate2";
2023-07-03 13:31:37 +01:00
rev = version;
2024-07-04 09:28:30 +01:00
hash = "sha256-hnotnEpw+5hVWVKknZHqiBSeDWy9XEjL3ojQD2ZXbAM=";
2023-07-03 13:31:37 +01:00
};
build-system = [ python3.pkgs.setuptools ];
dependencies = with python3.pkgs; [
2023-07-03 13:31:37 +01:00
ctranslate2
faster-whisper
numpy
pyannote-audio
2023-07-03 13:31:37 +01:00
sounddevice
tqdm
2023-07-03 13:31:37 +01:00
];
2023-10-08 16:10:19 +01:00
nativeCheckInputs = with python3.pkgs; [
nose2
];
checkPhase = ''
runHook preCheck
2023-10-08 16:10:19 +01:00
# Note: we are not running the `e2e-tests` because they require downloading models from the internet.
${python3.interpreter} -m nose2 -s tests
runHook postCheck
2023-10-08 16:10:19 +01:00
'';
passthru.updateScript = nix-update-script { };
2023-07-03 13:31:37 +01:00
meta = with lib; {
description = "Whisper command line client compatible with original OpenAI client based on CTranslate2";
homepage = "https://github.com/Softcatala/whisper-ctranslate2";
changelog = "https://github.com/Softcatala/whisper-ctranslate2/releases/tag/${version}";
license = licenses.mit;
maintainers = with maintainers; [ happysalada ];
2023-11-23 21:09:35 +00:00
mainProgram = "whisper-ctranslate2";
2023-07-03 13:31:37 +01:00
};
}