forked from neonbjb/tortoise-tts
-
Notifications
You must be signed in to change notification settings - Fork 0
/
flake.nix
110 lines (106 loc) · 3.92 KB
/
flake.nix
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
{
description = "Application packaged using poetry2nix";
inputs = {
flake-utils.url = "github:numtide/flake-utils";
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable-small";
poetry2nix = {
url = "github:nix-community/poetry2nix";
inputs.nixpkgs.follows = "nixpkgs";
};
};
outputs = { self, nixpkgs, flake-utils, poetry2nix }:
flake-utils.lib.eachDefaultSystem (system:
let
# see https://github.com/nix-community/poetry2nix/tree/master#api for more functions and examples.
pkgs = nixpkgs.legacyPackages.${system};
inherit (poetry2nix.lib.mkPoetry2Nix { inherit pkgs; }) mkPoetryApplication;
in
{
packages = {
myapp = mkPoetryApplication { projectDir = ./.; };
default = self.packages.${system}.myapp;
};
# Shell for app dependencies.
#
# nix develop
#
# Use this shell for developing your app.
devShells.default = pkgs.mkShell {
shellHook = ''
export CUDA_PATH=${pkgs.cudaPackages.cudatoolkit}
export LD_LIBRARY_PATH=${pkgs.cudaPackages.cuda_nvrtc}/lib
export EXTRA_LDFLAGS="-L/lib -L${pkgs.linuxPackages.nvidia_x11}/lib"
export EXTRA_CCFLAGS="-I/usr/include"
'';
packages = with pkgs; [
libtorch-bin
cudaPackages.cuda_nvrtc
cudaPackages.cudnn
python311Packages.torch-bin
python311Packages.torchaudio-bin
python311Packages.progressbar
python311Packages.einops
python311Packages.librosa
python311Packages.unidecode
python311Packages.inflect
python311Packages.rotary-embedding-torch
python311Packages.safetensors
python311Packages.transformers
(python311Packages.buildPythonPackage rec {
pname = "tortoise-tts";
version = "3.0.0";
doCheck = false;
buildInputs = [
python311Packages.pip
python311Packages.tokenizers
python311Packages.librosa
python311Packages.unidecode
python311Packages.einops
python311Packages.progressbar
python311Packages.inflect
python311Packages.rotary-embedding-torch
python311Packages.safetensors
(python311Packages.buildPythonPackage rec {
doCheck = false;
pname = "transformers";
version = "4.31.0";
buildInputs = [
python311Packages.tokenizers # Version might be wrong
python311Packages.pip
python311Packages.tqdm
python311Packages.safetensors
];
src = python311Packages.fetchPypi {
inherit pname version;
sha256 = "4302fba920a1c24d3a429a29efff6a63eac03f3f3cf55b55927fc795d01cb273";
};
})
];
src = python311Packages.fetchPypi {
inherit pname version;
sha256 = "8684aac23976ffa9813a4ec074b6bff0a348ce82a1923483e57d5d4e27dd21d6";
};
})
];
inputsFrom = [
pkgs.python311
pkgs.python311Packages.pip
pkgs.libtorch-bin
pkgs.python311Packages.torch-bin
pkgs.python311Packages.torchaudio-bin
pkgs.cudaPackages.cudnn
pkgs.cudaPackages.cuda_nvrtc
pkgs.cudaPackages.libcusparse
self.packages.${system}.myapp
];
};
# Shell for poetry.
#
# nix develop .#poetry
#
# Use this shell for changes to pyproject.toml and poetry.lock.
devShells.poetry = pkgs.mkShell {
packages = [ pkgs.poetry ];
};
});
}