summaryrefslogtreecommitdiff
path: root/pkgs/development/python-modules/kokoro/default.nix
blob: 11081dae7a5dab4e73234ac35dcc6c577229ea2c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
{
  buildPythonPackage,
  fetchFromGitHub,
  fetchPypi,
  hatchling,
  huggingface-hub,
  lib,
  loguru,
  misaki,
  numpy,
  pytestCheckHook,
  torch,
  transformers,
}:

buildPythonPackage {
  pname = "kokoro";
  version = "0-unstable-2025-06-16";
  pyproject = true;

  src = fetchFromGitHub {
    owner = "hexgrad";
    repo = "kokoro";
    rev = "2668b2e279d0f94977995230e523b0183763f30e";
    hash = "sha256-slXbn0W1632Hak6Z0ofF0gyavxRLoxS4fyPQLHSapjA=";
  };

  build-system = [
    hatchling
  ];

  dependencies = [
    huggingface-hub
    loguru
    misaki
    numpy
    torch
    transformers
  ]
  ++ misaki.optional-dependencies.en; # kokoro depends on misaki[en]

  nativeCheckInputs = [ pytestCheckHook ];

  disabledTests = [
    # See https://github.com/hexgrad/kokoro/issues/225
    "test_different_window_sizes"
    "test_stft_reconstruction"
  ];

  pythonImportsCheck = [
    "kokoro"
  ];

  meta = {
    description = "Open-weight TTS model with 82 million parameters";
    homepage = "https://github.com/hexgrad/kokoro";
    license = lib.licenses.asl20;
    maintainers = with lib.maintainers; [ samuela ];
  };
}