Unverified Commit 3eb5b4fb authored by Pavol Rusnak's avatar Pavol Rusnak
Browse files

tts: replace torch{,audio}-bin with torch{,audio}

parent e560040c
Loading
Loading
Loading
Loading
+9 −20
Original line number Diff line number Diff line
@@ -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;
  };
}