diff options
Diffstat (limited to 'pkgs/development/python-modules/trainer/default.nix')
-rw-r--r-- | pkgs/development/python-modules/trainer/default.nix | 64 |
1 files changed, 64 insertions, 0 deletions
diff --git a/pkgs/development/python-modules/trainer/default.nix b/pkgs/development/python-modules/trainer/default.nix new file mode 100644 index 0000000000000..627c21ee4bf00 --- /dev/null +++ b/pkgs/development/python-modules/trainer/default.nix @@ -0,0 +1,64 @@ +{ lib +, buildPythonPackage +, fetchpatch +, fetchFromGitHub +, pythonAtLeast + +, coqpit +, fsspec +, torch-bin +, tensorboardx +, protobuf + +, pytestCheckHook +, soundfile +, torchvision-bin +}: + +let + pname = "trainer"; + version = "0.0.16"; +in +buildPythonPackage { + inherit pname version; + format = "pyproject"; + + src = fetchFromGitHub { + owner = "coqui-ai"; + repo = "Trainer"; + rev = "refs/tags/v${version}"; + hash = "sha256-G2qFQEO5OOEI2jsb+zXsO8cbC13o7pqAC2xkFrhGkLc="; + }; + + postPatch = '' + sed -i 's/^protobuf.*/protobuf/' requirements.txt + ''; + + propagatedBuildInputs = [ + coqpit + fsspec + torch-bin + soundfile + tensorboardx + protobuf + ]; + + # only one test and that requires training data from the internet + doCheck = false; + + checkInputs = [ + pytestCheckHook + torchvision-bin + ]; + + pythonImportsCheck = [ + "trainer" + ]; + + meta = with lib; { + description = "A general purpose model trainer, as flexible as it gets"; + homepage = "https://github.com/coqui-ai/Trainer"; + license = licenses.asl20; + maintainers = teams.tts.members; + }; +} |