2024-06-05 15:53:02 +00:00
|
|
|
{
|
|
|
|
lib,
|
|
|
|
buildPythonPackage,
|
|
|
|
fetchFromGitHub,
|
|
|
|
fetchpatch,
|
2022-03-10 19:12:11 +00:00
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
coqpit,
|
|
|
|
fsspec,
|
|
|
|
torch,
|
|
|
|
tensorboard,
|
|
|
|
protobuf,
|
|
|
|
psutil,
|
2022-03-10 19:12:11 +00:00
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
pytestCheckHook,
|
|
|
|
soundfile,
|
|
|
|
torchvision,
|
2022-03-10 19:12:11 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
let
|
2022-11-21 17:40:18 +00:00
|
|
|
pname = "trainer";
|
2024-01-13 08:15:51 +00:00
|
|
|
version = "0.0.36";
|
2022-03-10 19:12:11 +00:00
|
|
|
in
|
|
|
|
buildPythonPackage {
|
|
|
|
inherit pname version;
|
|
|
|
format = "pyproject";
|
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "coqui-ai";
|
|
|
|
repo = "Trainer";
|
2022-08-12 12:06:08 +00:00
|
|
|
rev = "refs/tags/v${version}";
|
2024-01-13 08:15:51 +00:00
|
|
|
hash = "sha256-z6TOzWqE3NytkdG3nUzh9GpFVGQEXFyzSQ8gvdB4wiw=";
|
2022-03-10 19:12:11 +00:00
|
|
|
};
|
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
patches = [
|
|
|
|
(fetchpatch {
|
|
|
|
name = "add-support-for-python312.patch";
|
|
|
|
hash = "sha256-V5RPn/2pGKzQrf/SIRU3imo6nBhpBEJpI7HsFYbVZj4=";
|
|
|
|
url = "https://github.com/coqui-ai/Trainer/commit/0278012c7e6f5972b656d11757add4ab89f6d272.patch";
|
|
|
|
})
|
|
|
|
];
|
|
|
|
|
2022-10-06 18:32:54 +00:00
|
|
|
postPatch = ''
|
|
|
|
sed -i 's/^protobuf.*/protobuf/' requirements.txt
|
|
|
|
'';
|
|
|
|
|
2022-03-10 19:12:11 +00:00
|
|
|
propagatedBuildInputs = [
|
|
|
|
coqpit
|
|
|
|
fsspec
|
2023-02-02 18:25:31 +00:00
|
|
|
protobuf
|
|
|
|
psutil
|
2022-03-10 19:12:11 +00:00
|
|
|
soundfile
|
2023-07-15 17:15:38 +00:00
|
|
|
tensorboard
|
2024-01-02 11:29:13 +00:00
|
|
|
torch
|
2022-03-10 19:12:11 +00:00
|
|
|
];
|
|
|
|
|
2022-03-30 09:31:56 +00:00
|
|
|
# only one test and that requires training data from the internet
|
2022-03-10 19:12:11 +00:00
|
|
|
doCheck = false;
|
|
|
|
|
2023-02-02 18:25:31 +00:00
|
|
|
nativeCheckInputs = [
|
2022-03-10 19:12:11 +00:00
|
|
|
pytestCheckHook
|
2024-01-02 11:29:13 +00:00
|
|
|
torchvision
|
2022-03-10 19:12:11 +00:00
|
|
|
];
|
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
pythonImportsCheck = [ "trainer" ];
|
2022-03-10 19:12:11 +00:00
|
|
|
|
|
|
|
meta = with lib; {
|
2024-06-20 14:57:18 +00:00
|
|
|
description = "General purpose model trainer, as flexible as it gets";
|
2022-03-10 19:12:11 +00:00
|
|
|
homepage = "https://github.com/coqui-ai/Trainer";
|
2023-02-02 18:25:31 +00:00
|
|
|
changelog = "https://github.com/coqui-ai/Trainer/releases/tag/v${version}";
|
2022-03-10 19:12:11 +00:00
|
|
|
license = licenses.asl20;
|
|
|
|
maintainers = teams.tts.members;
|
|
|
|
};
|
|
|
|
}
|