nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{
2 lib,
3 buildPythonPackage,
4 fetchFromGitHub,
5 fetchpatch,
6
7 # build-system
8 setuptools,
9
10 # dependencies
11 huggingface-hub,
12 hyperpyyaml,
13 joblib,
14 numpy,
15 packaging,
16 sentencepiece,
17 scipy,
18 torch,
19 torchaudio,
20 tqdm,
21}:
22
23buildPythonPackage rec {
24 pname = "speechbrain";
25 version = "1.0.3";
26 pyproject = true;
27
28 src = fetchFromGitHub {
29 owner = "speechbrain";
30 repo = "speechbrain";
31 tag = "v${version}";
32 hash = "sha256-H45kTOIO6frbrRu+TP+udn1z60ZEcrShNB9iTCLInQs=";
33 };
34
35 patches = [
36 # https://github.com/speechbrain/speechbrain/pull/2988
37 (fetchpatch {
38 name = "torchaudio-2.9-compat.patch";
39 url = "https://github.com/speechbrain/speechbrain/commit/927530fa95e238fbc396000618e839a4a986dd7d.patch";
40 excludes = [ "pyproject.toml" ];
41 hash = "sha256-TJxBQLggX2ZHppUJwMcg9+A9r0r+D20XUfivBFW7y/U=";
42 })
43 ];
44
45 build-system = [ setuptools ];
46
47 dependencies = [
48 huggingface-hub
49 hyperpyyaml
50 joblib
51 numpy
52 packaging
53 sentencepiece
54 scipy
55 torch
56 torchaudio
57 tqdm
58 ];
59
60 doCheck = false; # requires sox backend
61
62 pythonImportsCheck = [ "speechbrain" ];
63
64 meta = {
65 description = "PyTorch-based Speech Toolkit";
66 homepage = "https://speechbrain.github.io";
67 changelog = "https://github.com/speechbrain/speechbrain/releases/tag/v${version}";
68 license = lib.licenses.asl20;
69 maintainers = with lib.maintainers; [ GaetanLepage ];
70 };
71}