tts, python3Packages.encodec: replace torch{,audio}-bin with torch{,audio} (#399785)

This commit is contained in:
Pavol Rusnak
2025-04-18 18:28:39 +02:00
committed by GitHub
4 changed files with 19 additions and 42 deletions
+12 -22
View File
@@ -8,32 +8,23 @@
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";
version = "0.26.0";
pyproject = true;
src = fetchFromGitHub {
owner = "idiap";
repo = "coqui-ai-TTS";
tag = "v${version}";
hash = "sha256-5w1Y9wdoJ+EV/WBwK3nqyY60NEsMjQsfE4g+sJB7VwQ=";
hash = "sha256-tLTurOwSzKvejb31yijmH3LFZGJHYp0OW0ckS7Ds5ig=";
};
postPatch =
let
relaxedConstraints = [
"bnunicodenormalizer"
"coqpit-config"
"cython"
"gruut"
"inflect"
@@ -55,7 +46,7 @@ python.pkgs.buildPythonApplication rec {
pyproject.toml
'';
nativeBuildInputs = with python.pkgs; [
nativeBuildInputs = with python3.pkgs; [
cython
numpy
packaging
@@ -63,7 +54,7 @@ python.pkgs.buildPythonApplication rec {
hatchling
];
propagatedBuildInputs = with python.pkgs; [
propagatedBuildInputs = with python3.pkgs; [
anyascii
bangla
bnnumerizer
@@ -92,8 +83,8 @@ python.pkgs.buildPythonApplication rec {
scipy
soundfile
tensorflow
torch-bin
torchaudio-bin
torch
torchaudio
tqdm
trainer
transformers
@@ -104,7 +95,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 +105,7 @@ python.pkgs.buildPythonApplication rec {
});
nativeCheckInputs =
with python.pkgs;
with python3.pkgs;
[
espeak-ng
pytestCheckHook
@@ -130,7 +121,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 +180,7 @@ python.pkgs.buildPythonApplication rec {
];
passthru = {
inherit python;
inherit python3;
};
meta = with lib; {
@@ -198,6 +189,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;
};
}
@@ -6,8 +6,8 @@
# dependencies
einops,
numpy,
torch-bin,
torchaudio-bin,
torch,
torchaudio,
}:
buildPythonPackage rec {
@@ -25,8 +25,8 @@ buildPythonPackage rec {
propagatedBuildInputs = [
einops
numpy
torch-bin
torchaudio-bin
torch
torchaudio
];
pythonImportsCheck = [ "encodec" ];
@@ -38,14 +38,12 @@
buildPythonPackage rec {
pname = "spacy";
version = "3.8.3";
version = "3.8.5";
pyproject = true;
disabled = pythonOlder "3.10";
src = fetchPypi {
inherit pname version;
hash = "sha256-galn3D1qWgqaslBVlIP+IJIwZYKpGS+Yvnpjvc4nl/c=";
hash = "sha256-OLyLh3+yT0FJBf8XliADFgfNMf5vkA1noGcwFCcVZRw=";
};
postPatch = ''
+1 -12
View File
@@ -16106,18 +16106,7 @@ self: super: with self; {
soxr = callPackage ../development/python-modules/soxr { libsoxr = pkgs.soxr; };
spacy = callPackage ../development/python-modules/spacy {
# fix error: _PyCFrame has no member named use_tracing
# see: https://aur.archlinux.org/packages/python-spacy
cython_0 = cython_0.overridePythonAttrs (old: rec {
version = "0.29.37";
src = pkgs.fetchPypi {
pname = "Cython";
inherit version;
hash = "sha256-+BPUpt2Ure5dT/JmGR0dlb9tQWSk+sxTVCLAIbJQTPs=";
};
});
};
spacy = callPackage ../development/python-modules/spacy { };
spacy-alignments = callPackage ../development/python-modules/spacy-alignments { };