Unverified Commit e2680ee3 authored by Jörg Thalheim's avatar Jörg Thalheim Committed by GitHub
Browse files

Unbreak tts (#366756)

parents 31942f20 b30678dc
Loading
Loading
Loading
Loading
+4 −4
Original line number Diff line number Diff line
@@ -126,7 +126,7 @@ in
              "${pkgs.tts}/bin/tts-server --port ${toString options.port} "
              + optionalString (options.model != null) "--model_name ${options.model} "
              + optionalString (options.useCuda) "--use_cuda "
              + (concatMapStringsSep " " escapeShellArgs options.extraArgs);
              + (escapeShellArgs options.extraArgs);
            CapabilityBoundingSet = "";
            DeviceAllow =
              if options.useCuda then
+21 −29
Original line number Diff line number Diff line
@@ -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;
  };
}
+17 −7
Original line number Diff line number Diff line
@@ -4,22 +4,32 @@
  fetchFromGitHub,
  pythonAtLeast,
  pytestCheckHook,
  hatchling,
  typing-extensions,
}:

buildPythonPackage rec {
  pname = "coqpit";
  version = "0.0.17";
  format = "setuptools";
  pname = "coqpit-config";
  version = "0.1.2";
  format = "pyproject";

  src = fetchFromGitHub {
    owner = "coqui-ai";
    repo = pname;
    owner = "idiap";
    repo = "coqui-ai-coqpit";
    rev = "refs/tags/v${version}";
    hash = "sha256-FY3PYd8dY5HFKkhD6kBzPt0k1eFugdqsO3yIN4oDk3E=";
    hash = "sha256-3LZxoj2aFTpezakBymogkNPCaEBBaaUmyIa742cSMgU=";
  };

  nativeCheckInputs = [ pytestCheckHook ];

  nativeBuildInputs = [
    hatchling
  ];

  propagatedBuildInputs = [
    typing-extensions
  ];

  pythonImportsCheck = [
    "coqpit"
    "coqpit.coqpit"
@@ -35,7 +45,7 @@ buildPythonPackage rec {
    longDescription = ''
      Simple, light-weight and no dependency config handling through python data classes with to/from JSON serialization/deserialization.
    '';
    homepage = "https://github.com/coqui-ai/coqpit";
    homepage = "https://github.com/idiap/coqui-ai-coqpit";
    license = licenses.mit;
    maintainers = teams.tts.members;
  };
+48 −0
Original line number Diff line number Diff line
{
  lib,
  buildPythonPackage,
  fetchFromGitHub,

  # build-system
  setuptools,
  cython,
  numpy_2,

  # dependencies
  torch,
}:

buildPythonPackage rec {
  pname = "monotonic-alignment-search";
  version = "0.1.1";
  pyproject = true;

  src = fetchFromGitHub {
    owner = "eginhard";
    repo = "monotonic_alignment_search";
    rev = "refs/tags/v${version}";
    hash = "sha256-qBkJKED0KVArhzmhZo8UuWQ55XMMBgvKM3xOwiPVwKU=";
  };

  build-system = [
    setuptools
    cython
    numpy_2
  ];

  dependencies = [
    torch
  ];

  pytestFlagsArray = [ "tests" ];

  pythonImportsCheck = [ "monotonic_alignment_search" ];

  meta = {
    homepage = "https://github.com/eginhard/monotonic_alignment_search";
    description = "Monotonically align text and speech";
    changelog = "https://github.com/eginhard/monotonic_alignment_search/releases/tag/v${version}";
    license = lib.licenses.mit;
    maintainers = with lib.maintainers; [ jbgi ];
  };
}
+11 −17
Original line number Diff line number Diff line
@@ -4,6 +4,8 @@
  fetchFromGitHub,
  fetchpatch,

  hatchling,

  coqpit,
  fsspec,
  torch,
@@ -17,32 +19,24 @@
}:

let
  pname = "trainer";
  version = "0.0.36";
  pname = "coqui-tts-trainer";
  version = "0.2.0";
in
buildPythonPackage {
  inherit pname version;
  format = "pyproject";

  src = fetchFromGitHub {
    owner = "coqui-ai";
    repo = "Trainer";
    owner = "idiap";
    repo = "coqui-ai-Trainer";
    rev = "refs/tags/v${version}";
    hash = "sha256-z6TOzWqE3NytkdG3nUzh9GpFVGQEXFyzSQ8gvdB4wiw=";
    hash = "sha256-zm8BTfXvfwuWpmHFcSxuu+/V4bKanSBU2dniQboVdLY=";
  };

  patches = [
    (fetchpatch {
      name = "add-support-for-python312.patch";
      hash = "sha256-V5RPn/2pGKzQrf/SIRU3imo6nBhpBEJpI7HsFYbVZj4=";
      url = "https://github.com/coqui-ai/Trainer/commit/0278012c7e6f5972b656d11757add4ab89f6d272.patch";
    })
  nativeBuildInputs = [
    hatchling
  ];

  postPatch = ''
    sed -i 's/^protobuf.*/protobuf/' requirements.txt
  '';

  propagatedBuildInputs = [
    coqpit
    fsspec
@@ -65,8 +59,8 @@ buildPythonPackage {

  meta = with lib; {
    description = "General purpose model trainer, as flexible as it gets";
    homepage = "https://github.com/coqui-ai/Trainer";
    changelog = "https://github.com/coqui-ai/Trainer/releases/tag/v${version}";
    homepage = "https://github.com/idiap/coqui-ai-Trainer";
    changelog = "https://github.com/idiap/coqui-ai-Trainer/releases/tag/v${version}";
    license = licenses.asl20;
    maintainers = teams.tts.members;
  };
Loading