1{
2 lib,
3 buildPythonPackage,
4 fetchFromGitHub,
5 pythonRelaxDepsHook,
6
7 # build-system
8 setuptools,
9
10 # dependencies
11 av,
12 ctranslate2,
13 huggingface-hub,
14 onnxruntime,
15 tokenizers,
16
17 # tests
18 pytestCheckHook,
19}:
20
21buildPythonPackage rec {
22 pname = "faster-whisper";
23 version = "1.0.2";
24 pyproject = true;
25
26 src = fetchFromGitHub {
27 owner = "SYSTRAN";
28 repo = "faster-whisper";
29 rev = "refs/tags/v${version}";
30 hash = "sha256-O2RRwb+omgSpfckHh3oPu454g2ULT4gyolrg5olHcRc=";
31 };
32
33 build-system = [
34 setuptools
35 pythonRelaxDepsHook
36 ];
37
38 pythonRelaxDeps = [ "tokenizers" ];
39
40 dependencies = [
41 av
42 ctranslate2
43 huggingface-hub
44 onnxruntime
45 tokenizers
46 ];
47
48 pythonImportsCheck = [ "faster_whisper" ];
49
50 # all tests require downloads
51 doCheck = false;
52
53 nativeCheckInputs = [ pytestCheckHook ];
54
55 preCheck = ''
56 export HOME=$TMPDIR
57 '';
58
59 meta = with lib; {
60 changelog = "https://github.com/SYSTRAN/faster-whisper/releases/tag/v${version}";
61 description = "Faster Whisper transcription with CTranslate2";
62 homepage = "https://github.com/SYSTRAN/faster-whisper";
63 license = licenses.mit;
64 maintainers = with maintainers; [ hexa ];
65 };
66}