2023-07-15 17:15:38 +00:00
|
|
|
{ buildPythonPackage
|
|
|
|
, piper-tts
|
2023-01-20 10:41:00 +00:00
|
|
|
|
|
|
|
# build
|
|
|
|
, cython
|
|
|
|
, python
|
|
|
|
|
|
|
|
# propagates
|
|
|
|
, espeak-phonemizer
|
|
|
|
, librosa
|
|
|
|
, numpy
|
|
|
|
, onnxruntime
|
|
|
|
, pytorch-lightning
|
|
|
|
, torch
|
|
|
|
}:
|
|
|
|
|
2023-07-15 17:15:38 +00:00
|
|
|
buildPythonPackage {
|
|
|
|
inherit (piper-tts) version src meta;
|
2023-01-20 10:41:00 +00:00
|
|
|
|
2023-07-15 17:15:38 +00:00
|
|
|
pname = "piper-train";
|
2023-01-20 10:41:00 +00:00
|
|
|
format = "setuptools";
|
|
|
|
|
|
|
|
sourceRoot = "source/src/python";
|
|
|
|
|
|
|
|
nativeBuildInputs = [
|
|
|
|
cython
|
|
|
|
];
|
|
|
|
|
|
|
|
postPatch = ''
|
|
|
|
substituteInPlace requirements.txt \
|
|
|
|
--replace "onnxruntime~=1.11.0" "onnxruntime" \
|
|
|
|
--replace "pytorch-lightning~=1.7.0" "pytorch-lightning" \
|
|
|
|
--replace "torch~=1.11.0" "torch"
|
|
|
|
'';
|
|
|
|
|
|
|
|
postBuild = ''
|
2023-07-15 17:15:38 +00:00
|
|
|
make -C piper_train/vits/monotonic_align
|
2023-01-20 10:41:00 +00:00
|
|
|
'';
|
|
|
|
|
|
|
|
postInstall = ''
|
2023-07-15 17:15:38 +00:00
|
|
|
export MONOTONIC_ALIGN=$out/${python.sitePackages}/piper_train/vits/monotonic_align/monotonic_align
|
2023-01-20 10:41:00 +00:00
|
|
|
mkdir -p $MONOTONIC_ALIGN
|
2023-07-15 17:15:38 +00:00
|
|
|
cp -v ./piper_train/vits/monotonic_align/piper_train/vits/monotonic_align/core.*.so $MONOTONIC_ALIGN/
|
2023-01-20 10:41:00 +00:00
|
|
|
'';
|
|
|
|
|
|
|
|
propagatedBuildInputs = [
|
|
|
|
espeak-phonemizer
|
|
|
|
librosa
|
|
|
|
numpy
|
|
|
|
onnxruntime
|
|
|
|
pytorch-lightning
|
|
|
|
torch
|
|
|
|
];
|
|
|
|
|
|
|
|
pythonImportsCheck = [
|
2023-07-15 17:15:38 +00:00
|
|
|
"piper_train"
|
2023-01-20 10:41:00 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
doCheck = false; # no tests
|
|
|
|
}
|