anvil-editor: init at 0.4
[NixPkgs.git] / pkgs / tools / audio / piper / train.nix
blob476138e788379957638baa7977454844f5b41929
1 { piper-tts
2 , python3
3 }:
5 let
6   python = python3;
7 in
9 python.pkgs.buildPythonPackage {
10   inherit (piper-tts) version src;
12   pname = "piper-train";
13   format = "setuptools";
15   sourceRoot = "${piper-tts.src.name}/src/python";
17   nativeBuildInputs = with python.pkgs; [
18     cython
19   ];
21   postBuild = ''
22     make -C piper_train/vits/monotonic_align
23   '';
25   postInstall = ''
26     export MONOTONIC_ALIGN=$out/${python.sitePackages}/piper_train/vits/monotonic_align/monotonic_align
27     mkdir -p $MONOTONIC_ALIGN
28     cp -v ./piper_train/vits/monotonic_align/piper_train/vits/monotonic_align/core.*.so $MONOTONIC_ALIGN/
29   '';
31   propagatedBuildInputs = with python.pkgs; [
32     espeak-phonemizer
33     librosa
34     numpy
35     onnxruntime
36     piper-phonemize
37     pytorch-lightning
38     torch
39   ];
41   pythonImportsCheck = [
42     "piper_train"
43   ];
45   doCheck = false; # no tests
47   meta = piper-tts.meta // {
48     # requires torch<2, pytorch-lightning~=1.7
49     broken = true;
50   };