From 4cc13ba7c87dc8eb646f9cbf71a06c9a61b082ef Mon Sep 17 00:00:00 2001 From: Jean-Baptiste Giraudeau Date: Fri, 20 Dec 2024 10:35:53 +0100 Subject: [PATCH] tts: 0.20.2 -> 0.25.1 and switch to idiap fork to unbreak build: original coqui-ai repo is not maintained anymore. https://www.idiap.ch/en/ --- pkgs/by-name/tt/tts/package.nix | 50 ++++++++++++++------------------- 1 file changed, 21 insertions(+), 29 deletions(-) diff --git a/pkgs/by-name/tt/tts/package.nix b/pkgs/by-name/tt/tts/package.nix index cbaf8aa21f0c1..308561f0ab684 100644 --- a/pkgs/by-name/tt/tts/package.nix +++ b/pkgs/by-name/tt/tts/package.nix @@ -17,15 +17,15 @@ let }; in python.pkgs.buildPythonApplication rec { - pname = "tts"; - version = "0.20.2"; + pname = "coqui-tts"; + version = "0.25.1"; pyproject = true; src = fetchFromGitHub { - owner = "coqui-ai"; - repo = "TTS"; + owner = "idiap"; + repo = "coqui-ai-TTS"; rev = "refs/tags/v${version}"; - hash = "sha256-1nlSf15IEX1qKfDtR6+jQqskjxIuzaIWatkj9Z1fh8Y="; + hash = "sha256-5w1Y9wdoJ+EV/WBwK3nqyY60NEsMjQsfE4g+sJB7VwQ="; }; postPatch = @@ -41,22 +41,16 @@ python.pkgs.buildPythonApplication rec { "numpy" "unidic-lite" "trainer" + "spacy\\[ja\\]" + "transformers" ]; in '' - sed -r -i \ - ${lib.concatStringsSep "\n" ( - map (package: ''-e 's/${package}\s*[<>=]+.+/${package}/g' \'') relaxedConstraints - )} - requirements.txt - sed -r -i \ ${lib.concatStringsSep "\n" ( map (package: ''-e 's/${package}\s*[<>=]+[^"]+/${package}/g' \'') relaxedConstraints )} pyproject.toml - # only used for notebooks and visualization - sed -r -i -e '/umap-learn/d' requirements.txt ''; nativeBuildInputs = with python.pkgs; [ @@ -64,6 +58,7 @@ python.pkgs.buildPythonApplication rec { numpy packaging setuptools + hatchling ]; propagatedBuildInputs = with python.pkgs; [ @@ -102,15 +97,12 @@ python.pkgs.buildPythonApplication rec { transformers unidic-lite webrtcvad + spacy + monotonic-alignment-search ]; postInstall = '' cp -r TTS/server/templates/ $out/${python.sitePackages}/TTS/server - # cython modules are not installed for some reasons - ( - cd TTS/tts/utils/monotonic_align - ${python.pythonOnBuildForHost.interpreter} setup.py install --prefix=$out - ) ''; # tests get stuck when run in nixpkgs-review, tested in passthru @@ -161,14 +153,14 @@ python.pkgs.buildPythonApplication rec { "tests/text_tests/test_phonemizer.py" # no training, it takes too long "tests/aux_tests/test_speaker_encoder_train.py" - "tests/tts_tests/test_align_tts_train.py" - "tests/tts_tests/test_fast_pitch_speaker_emb_train.py" - "tests/tts_tests/test_fast_pitch_train.py" - "tests/tts_tests/test_fastspeech_2_speaker_emb_train.py" - "tests/tts_tests/test_fastspeech_2_train.py" - "tests/tts_tests/test_glow_tts_d-vectors_train.py" - "tests/tts_tests/test_glow_tts_speaker_emb_train.py" - "tests/tts_tests/test_glow_tts_train.py" + "tests/tts_tests2/test_align_tts_train.py" + "tests/tts_tests2/test_fast_pitch_speaker_emb_train.py" + "tests/tts_tests2/test_fast_pitch_train.py" + "tests/tts_tests2/test_fastspeech_2_speaker_emb_train.py" + "tests/tts_tests2/test_fastspeech_2_train.py" + "tests/tts_tests2/test_glow_tts_d-vectors_train.py" + "tests/tts_tests2/test_glow_tts_speaker_emb_train.py" + "tests/tts_tests2/test_glow_tts_train.py" "tests/tts_tests/test_neuralhmm_tts_train.py" "tests/tts_tests/test_overflow_train.py" "tests/tts_tests/test_speedy_speech_train.py" @@ -197,11 +189,11 @@ python.pkgs.buildPythonApplication rec { }; meta = with lib; { - homepage = "https://github.com/coqui-ai/TTS"; - changelog = "https://github.com/coqui-ai/TTS/releases/tag/v${version}"; + homepage = "https://github.com/idiap/coqui-ai-TTS"; + changelog = "https://github.com/idiap/coqui-ai-TTS/releases/tag/v${version}"; description = "Deep learning toolkit for Text-to-Speech, battle-tested in research and production"; license = licenses.mpl20; maintainers = teams.tts.members; - broken = true; # added 2024-04-08 + broken = false; }; }