1{ lib
2, buildPythonPackage
3, fetchpatch
4, fetchFromGitHub
5, pythonAtLeast
6
7, coqpit
8, fsspec
9, torch-bin
10, tensorboardx
11, protobuf
12
13, pytestCheckHook
14, soundfile
15, torchvision-bin
16}:
17
18let
19 pname = "trainer";
20 version = "0.0.16";
21in
22buildPythonPackage {
23 inherit pname version;
24 format = "pyproject";
25
26 src = fetchFromGitHub {
27 owner = "coqui-ai";
28 repo = "Trainer";
29 rev = "refs/tags/v${version}";
30 hash = "sha256-G2qFQEO5OOEI2jsb+zXsO8cbC13o7pqAC2xkFrhGkLc=";
31 };
32
33 postPatch = ''
34 sed -i 's/^protobuf.*/protobuf/' requirements.txt
35 '';
36
37 propagatedBuildInputs = [
38 coqpit
39 fsspec
40 torch-bin
41 soundfile
42 tensorboardx
43 protobuf
44 ];
45
46 # only one test and that requires training data from the internet
47 doCheck = false;
48
49 checkInputs = [
50 pytestCheckHook
51 torchvision-bin
52 ];
53
54 pythonImportsCheck = [
55 "trainer"
56 ];
57
58 meta = with lib; {
59 description = "A general purpose model trainer, as flexible as it gets";
60 homepage = "https://github.com/coqui-ai/Trainer";
61 license = licenses.asl20;
62 maintainers = teams.tts.members;
63 };
64}