From 24c0ba0ffcce19a168a61bac47c96d7d7e9e930e Mon Sep 17 00:00:00 2001 From: Martin Weinelt Date: Thu, 3 Aug 2023 03:03:21 +0200 Subject: [PATCH] piper-train: move to top-level and mark broken Requires torch<2, which is difficult to provide in an override, so I'd rather wait until they catch up. --- .../audio/piper/train.nix} | 44 ++++++++----------- pkgs/top-level/all-packages.nix | 2 +- pkgs/top-level/python-aliases.nix | 1 - pkgs/top-level/python-packages.nix | 2 - 4 files changed, 19 insertions(+), 30 deletions(-) rename pkgs/{development/python-modules/piper-train/default.nix => tools/audio/piper/train.nix} (56%) diff --git a/pkgs/development/python-modules/piper-train/default.nix b/pkgs/tools/audio/piper/train.nix similarity index 56% rename from pkgs/development/python-modules/piper-train/default.nix rename to pkgs/tools/audio/piper/train.nix index 3adb94c8f229..a385ebb85ad6 100644 --- a/pkgs/development/python-modules/piper-train/default.nix +++ b/pkgs/tools/audio/piper/train.nix @@ -1,39 +1,26 @@ -{ buildPythonPackage -, piper-tts - -# build -, cython -, python - -# propagates -, espeak-phonemizer -, librosa -, numpy -, onnxruntime -, piper-phonemize -, pytorch-lightning -, torch +{ piper-tts +, python3 }: -buildPythonPackage { - inherit (piper-tts) version src meta; +let + python = python3.override { + packageOverrides = self: super: { + }; + }; +in + +python.pkgs.buildPythonPackage { + inherit (piper-tts) version src; pname = "piper-train"; format = "setuptools"; sourceRoot = "source/src/python"; - nativeBuildInputs = [ + nativeBuildInputs = with python.pkgs; [ 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 = '' make -C piper_train/vits/monotonic_align ''; @@ -44,7 +31,7 @@ buildPythonPackage { cp -v ./piper_train/vits/monotonic_align/piper_train/vits/monotonic_align/core.*.so $MONOTONIC_ALIGN/ ''; - propagatedBuildInputs = [ + propagatedBuildInputs = with python.pkgs; [ espeak-phonemizer librosa numpy @@ -59,4 +46,9 @@ buildPythonPackage { ]; doCheck = false; # no tests + + meta = piper-tts.meta // { + # requires torch<2, pytorch-lightning~=1.7 + broken = true; + }; } diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index c7201ca7d59a..09407ff1ca05 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -11709,7 +11709,7 @@ with pkgs; pim6sd = callPackage ../servers/pim6sd { }; piper-phonemize = callPackage ../development/libraries/piper-phonemize { }; - piper-train = with python3Packages; toPythonApplication piper-train; + piper-train = callPackage ../tools/audio/piper/train.nix { }; piper-tts = callPackage ../tools/audio/piper { }; phosh = callPackage ../applications/window-managers/phosh { }; diff --git a/pkgs/top-level/python-aliases.nix b/pkgs/top-level/python-aliases.nix index a6ef2838bcb6..63addfa58a03 100644 --- a/pkgs/top-level/python-aliases.nix +++ b/pkgs/top-level/python-aliases.nix @@ -184,7 +184,6 @@ mapAliases ({ jupyter_server = jupyter-server; # added 2023-01-05 Kajiki = kajiki; # added 2023-02-19 Keras = keras; # added 2021-11-25 - larynx-train = piper-train; # added 2023-06-09 ldap = python-ldap; # added 2022-09-16 lammps-cython = throw "lammps-cython no longer builds and is unmaintained"; # added 2021-07-04 logilab_astng = throw "logilab-astng has not been released since 2013 and is unmaintained"; # added 2022-11-29 diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index e3e9a7ce7a60..bf738d556a9f 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -7970,8 +7970,6 @@ self: super: with self; { piper-phonemize-native = pkgs.piper-phonemize; }; - piper-train = callPackage ../development/python-modules/piper-train { }; - pip-api = callPackage ../development/python-modules/pip-api { }; pip-tools = callPackage ../development/python-modules/pip-tools { };