1{
2 lib,
3 buildPythonPackage,
4 fetchFromGitHub,
5
6 coqpit,
7 fsspec,
8 torch,
9 tensorboard,
10 protobuf,
11 psutil,
12
13 pytestCheckHook,
14 soundfile,
15 torchvision,
16}:
17
18let
19 pname = "trainer";
20 version = "0.0.36";
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-z6TOzWqE3NytkdG3nUzh9GpFVGQEXFyzSQ8gvdB4wiw=";
31 };
32
33 postPatch = ''
34 sed -i 's/^protobuf.*/protobuf/' requirements.txt
35 '';
36
37 propagatedBuildInputs = [
38 coqpit
39 fsspec
40 protobuf
41 psutil
42 soundfile
43 tensorboard
44 torch
45 ];
46
47 # only one test and that requires training data from the internet
48 doCheck = false;
49
50 nativeCheckInputs = [
51 pytestCheckHook
52 torchvision
53 ];
54
55 pythonImportsCheck = [ "trainer" ];
56
57 meta = with lib; {
58 description = "A general purpose model trainer, as flexible as it gets";
59 homepage = "https://github.com/coqui-ai/Trainer";
60 changelog = "https://github.com/coqui-ai/Trainer/releases/tag/v${version}";
61 license = licenses.asl20;
62 maintainers = teams.tts.members;
63 };
64}