From 3eb5b4fbbddf035dd45390a26d902f78878c7839 Mon Sep 17 00:00:00 2001 From: Pavol Rusnak Date: Fri, 18 Apr 2025 17:23:45 +0200 Subject: [PATCH] tts: replace torch{,audio}-bin with torch{,audio} --- pkgs/by-name/tt/tts/package.nix | 29 +++++++++-------------------- 1 file changed, 9 insertions(+), 20 deletions(-) diff --git a/pkgs/by-name/tt/tts/package.nix b/pkgs/by-name/tt/tts/package.nix index 89ffb9f86f99..0ca185eec217 100644 --- a/pkgs/by-name/tt/tts/package.nix +++ b/pkgs/by-name/tt/tts/package.nix @@ -8,17 +8,7 @@ writableTmpDirAsHomeHook, }: -let - python = python3.override { - self = python; - packageOverrides = self: super: { - torch = super.torch-bin; - torchvision = super.torchvision-bin; - tensorflow = super.tensorflow-bin; - }; - }; -in -python.pkgs.buildPythonApplication rec { +python3.pkgs.buildPythonApplication rec { pname = "coqui-tts"; version = "0.25.1"; pyproject = true; @@ -55,7 +45,7 @@ python.pkgs.buildPythonApplication rec { pyproject.toml ''; - nativeBuildInputs = with python.pkgs; [ + nativeBuildInputs = with python3.pkgs; [ cython numpy packaging @@ -63,7 +53,7 @@ python.pkgs.buildPythonApplication rec { hatchling ]; - propagatedBuildInputs = with python.pkgs; [ + propagatedBuildInputs = with python3.pkgs; [ anyascii bangla bnnumerizer @@ -92,8 +82,8 @@ python.pkgs.buildPythonApplication rec { scipy soundfile tensorflow - torch-bin - torchaudio-bin + torch + torchaudio tqdm trainer transformers @@ -104,7 +94,7 @@ python.pkgs.buildPythonApplication rec { ]; postInstall = '' - cp -r TTS/server/templates/ $out/${python.sitePackages}/TTS/server + cp -r TTS/server/templates/ $out/${python3.sitePackages}/TTS/server ''; # tests get stuck when run in nixpkgs-review, tested in passthru @@ -114,7 +104,7 @@ python.pkgs.buildPythonApplication rec { }); nativeCheckInputs = - with python.pkgs; + with python3.pkgs; [ espeak-ng pytestCheckHook @@ -130,7 +120,7 @@ python.pkgs.buildPythonApplication rec { for file in $(grep -rl 'python TTS/bin' tests); do substituteInPlace "$file" \ - --replace "python TTS/bin" "${python.interpreter} $out/${python.sitePackages}/TTS/bin" + --replace "python TTS/bin" "${python3.interpreter} $out/${python3.sitePackages}/TTS/bin" done ''; @@ -189,7 +179,7 @@ python.pkgs.buildPythonApplication rec { ]; passthru = { - inherit python; + inherit python3; }; meta = with lib; { @@ -198,6 +188,5 @@ python.pkgs.buildPythonApplication rec { description = "Deep learning toolkit for Text-to-Speech, battle-tested in research and production"; license = licenses.mpl20; maintainers = teams.tts.members; - broken = false; }; }