about summary refs log tree commit diff
path: root/pkgs/development/python-modules/trainer/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/development/python-modules/trainer/default.nix')
-rw-r--r--pkgs/development/python-modules/trainer/default.nix40
1 files changed, 24 insertions, 16 deletions
diff --git a/pkgs/development/python-modules/trainer/default.nix b/pkgs/development/python-modules/trainer/default.nix
index 848b970248f0..117e954e7f30 100644
--- a/pkgs/development/python-modules/trainer/default.nix
+++ b/pkgs/development/python-modules/trainer/default.nix
@@ -1,17 +1,19 @@
-{ lib
-, buildPythonPackage
-, fetchFromGitHub
+{
+  lib,
+  buildPythonPackage,
+  fetchFromGitHub,
+  fetchpatch,
 
-, coqpit
-, fsspec
-, torch
-, tensorboard
-, protobuf
-, psutil
+  coqpit,
+  fsspec,
+  torch,
+  tensorboard,
+  protobuf,
+  psutil,
 
-, pytestCheckHook
-, soundfile
-, torchvision
+  pytestCheckHook,
+  soundfile,
+  torchvision,
 }:
 
 let
@@ -29,6 +31,14 @@ buildPythonPackage {
     hash = "sha256-z6TOzWqE3NytkdG3nUzh9GpFVGQEXFyzSQ8gvdB4wiw=";
   };
 
+  patches = [
+    (fetchpatch {
+      name = "add-support-for-python312.patch";
+      hash = "sha256-V5RPn/2pGKzQrf/SIRU3imo6nBhpBEJpI7HsFYbVZj4=";
+      url = "https://github.com/coqui-ai/Trainer/commit/0278012c7e6f5972b656d11757add4ab89f6d272.patch";
+    })
+  ];
+
   postPatch = ''
     sed -i 's/^protobuf.*/protobuf/' requirements.txt
   '';
@@ -51,12 +61,10 @@ buildPythonPackage {
     torchvision
   ];
 
-  pythonImportsCheck = [
-    "trainer"
-  ];
+  pythonImportsCheck = [ "trainer" ];
 
   meta = with lib; {
-    description = "A general purpose model trainer, as flexible as it gets";
+    description = "General purpose model trainer, as flexible as it gets";
     homepage = "https://github.com/coqui-ai/Trainer";
     changelog = "https://github.com/coqui-ai/Trainer/releases/tag/v${version}";
     license = licenses.asl20;