在NixOS上使用so-vits-svc项目

在NixOS上使用so-vits-svc项目

2024-08-11

在2024年7月,我把系统从ArchLinux迁移到了NixOS,自然就用上了nix包管理器。迁移完后感觉一切都清爽了,但同时,有很多事情要解决。

迁移完后,我首先需要解决纳西妲语音模型合成音频的问题。

我之前在ArchLinux上使用so-vits-svc来合成,这是一个Python项目,我在翻阅很多文献后决定使用flake+venv来安装运行环境,但好巧不巧,它官方推荐的Python版本是3.8.9,而nix官方包最低只提供3.9版本,怎么办呢?

使用3.9版本的Python

既然3.8.9版本的Python官方不提供包,那我们就用3.9的Python吧(反正就差了0.0.1而已)。

创建flake.nix文件

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
{
  description = "Python venv development template";
  inputs.utils.url = "github:numtide/flake-utils";
  outputs = { nixpkgs, utils, ... }:
    utils.lib.eachDefaultSystem (system: let
      pkgs = import nixpkgs { inherit system; };
      pythonPackages = pkgs.python39Packages;
    in {
      devShells.default = pkgs.mkShell {
        name = "python-venv";
        venvDir = "./.venv";
        buildInputs = [
          pythonPackages.python
          pythonPackages.venvShellHook
          pythonPackages.numpy
        ];
        postVenvCreation = ''
          unset SOURCE_DATE_EPOCH
          pip install -r requirements.txt
        '';
        postShellHook = ''
          unset SOURCE_DATE_EPOCH
          if [ -z "$LD_LIBRARY_PATH" ]; then
            export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:${pkgs.stdenv.cc.cc.lib}/lib/:${pkgs.libsndfile.out}/lib/:/run/opengl-driver/lib/"
          else
            export LD_LIBRARY_PATH="${pkgs.stdenv.cc.cc.lib}/lib/:${pkgs.libsndfile.out}/lib/:/run/opengl-driver/lib/"
          fi
        '';
      };
    });
}

创建.envrc文件

direnv在每次切换目录时寻找.envrc文件以自动加载运行环境:

TEXT
1
use flake

然后输入下面这条命令,让direnv信任我们的.envrc文件:

BASH
1
direnv allow
Pip的输出
TEXT
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
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
Collecting ffmpeg-python
  Using cached ffmpeg_python-0.2.0-py3-none-any.whl (25 kB)
Collecting Flask
  Using cached flask-3.0.3-py3-none-any.whl (101 kB)
Collecting Flask_Cors
  Using cached Flask_Cors-4.0.1-py2.py3-none-any.whl (14 kB)
Collecting gradio>=3.7.0
  Using cached gradio-4.41.0-py3-none-any.whl (12.6 MB)
Collecting numpy==1.23.5
  Using cached numpy-1.23.5-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (17.1 MB)
Collecting pyworld
  Using cached pyworld-0.3.4-cp39-cp39-linux_x86_64.whl
Collecting scipy==1.10.0
  Using cached scipy-1.10.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (34.4 MB)
Collecting SoundFile==0.12.1
  Using cached soundfile-0.12.1-py2.py3-none-manylinux_2_31_x86_64.whl (1.2 MB)
Collecting torch
  Using cached torch-2.4.0-cp39-cp39-manylinux1_x86_64.whl (797.2 MB)
Collecting torchaudio
  Using cached torchaudio-2.4.0-cp39-cp39-manylinux1_x86_64.whl (3.4 MB)
Collecting torchcrepe
  Using cached torchcrepe-0.0.23-py3-none-any.whl (72.3 MB)
Collecting tqdm
  Using cached tqdm-4.66.5-py3-none-any.whl (78 kB)
Collecting rich
  Using cached rich-13.7.1-py3-none-any.whl (240 kB)
Collecting loguru
  Using cached loguru-0.7.2-py3-none-any.whl (62 kB)
Collecting scikit-maad
  Using cached scikit_maad-1.4.3-py3-none-any.whl (162 kB)
Collecting praat-parselmouth
  Using cached praat_parselmouth-0.4.4-cp39-cp39-manylinux_2_12_x86_64.manylinux2010_x86_64.whl (10.7 MB)
Collecting onnx
  Using cached onnx-1.16.2-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (15.9 MB)
Collecting onnxsim
  Using cached onnxsim-0.4.36-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (2.3 MB)
Collecting onnxoptimizer
  Using cached onnxoptimizer-0.3.13-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (678 kB)
Collecting fairseq==0.12.2
  Using cached fairseq-0.12.2-cp39-cp39-linux_x86_64.whl
Collecting librosa==0.9.1
  Using cached librosa-0.9.1-py3-none-any.whl (213 kB)
Collecting tensorboard
  Using cached tensorboard-2.17.0-py3-none-any.whl (5.5 MB)
Collecting tensorboardX
  Using cached tensorboardX-2.6.2.2-py2.py3-none-any.whl (101 kB)
Collecting transformers
  Using cached transformers-4.44.0-py3-none-any.whl (9.5 MB)
Collecting edge_tts
  Using cached edge_tts-6.1.12-py3-none-any.whl (29 kB)
Collecting langdetect
  Using cached langdetect-1.0.9.tar.gz (981 kB)
  Preparing metadata (setup.py): started
  Preparing metadata (setup.py): finished with status 'done'
Collecting pyyaml
  Using cached PyYAML-6.0.2-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (737 kB)
Collecting pynvml
  Using cached pynvml-11.5.3-py3-none-any.whl (53 kB)
Collecting faiss-cpu
  Using cached faiss_cpu-1.8.0.post1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (27.0 MB)
Collecting einops
  Using cached einops-0.8.0-py3-none-any.whl (43 kB)
Collecting local_attention
  Using cached local_attention-1.9.14-py3-none-any.whl (9.0 kB)
Collecting cffi>=1.0
  Using cached cffi-1.17.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (444 kB)
Collecting sacrebleu>=1.4.12
  Using cached sacrebleu-2.4.2-py3-none-any.whl (106 kB)
Collecting bitarray
  Using cached bitarray-2.9.2-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (286 kB)
Collecting hydra-core<1.1,>=1.0.7
  Using cached hydra_core-1.0.7-py3-none-any.whl (123 kB)
Collecting omegaconf<2.1
  Using cached omegaconf-2.0.6-py3-none-any.whl (36 kB)
Collecting regex
  Using cached regex-2024.7.24-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (775 kB)
Collecting cython
  Using cached Cython-3.0.11-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (3.6 MB)
Collecting scikit-learn>=0.19.1
  Using cached scikit_learn-1.5.1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (13.4 MB)
Collecting resampy>=0.2.2
  Using cached resampy-0.4.3-py3-none-any.whl (3.1 MB)
Collecting packaging>=20.0
  Using cached packaging-24.1-py3-none-any.whl (53 kB)
Collecting decorator>=4.0.10
  Using cached decorator-5.1.1-py3-none-any.whl (9.1 kB)
Collecting pooch>=1.0
  Using cached pooch-1.8.2-py3-none-any.whl (64 kB)
Collecting audioread>=2.1.5
  Using cached audioread-3.0.1-py3-none-any.whl (23 kB)
Collecting numba>=0.45.1
  Using cached numba-0.60.0-cp39-cp39-manylinux2014_x86_64.manylinux_2_17_x86_64.whl (3.7 MB)
Collecting joblib>=0.14
  Using cached joblib-1.4.2-py3-none-any.whl (301 kB)
Collecting future
  Using cached future-1.0.0-py3-none-any.whl (491 kB)
Collecting blinker>=1.6.2
  Using cached blinker-1.8.2-py3-none-any.whl (9.5 kB)
Collecting Werkzeug>=3.0.0
  Using cached werkzeug-3.0.3-py3-none-any.whl (227 kB)
Collecting Jinja2>=3.1.2
  Using cached jinja2-3.1.4-py3-none-any.whl (133 kB)
Collecting click>=8.1.3
  Using cached click-8.1.7-py3-none-any.whl (97 kB)
Collecting importlib-metadata>=3.6.0
  Using cached importlib_metadata-8.2.0-py3-none-any.whl (25 kB)
Collecting itsdangerous>=2.1.2
  Using cached itsdangerous-2.2.0-py3-none-any.whl (16 kB)
Collecting pydub
  Using cached pydub-0.25.1-py2.py3-none-any.whl (32 kB)
Collecting ruff>=0.2.2
  Using cached ruff-0.5.7-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (10.2 MB)
Collecting anyio<5.0,>=3.0
  Using cached anyio-4.4.0-py3-none-any.whl (86 kB)
Collecting urllib3~=2.0
  Using cached urllib3-2.2.2-py3-none-any.whl (121 kB)
Collecting pandas<3.0,>=1.0
  Using cached pandas-2.2.2-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (13.1 MB)
Collecting importlib-resources<7.0,>=1.3
  Using cached importlib_resources-6.4.0-py3-none-any.whl (38 kB)
Collecting huggingface-hub>=0.19.3
  Using cached huggingface_hub-0.24.5-py3-none-any.whl (417 kB)
Collecting matplotlib~=3.0
  Using cached matplotlib-3.9.1.post1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (8.3 MB)
Collecting uvicorn>=0.14.0
  Using cached uvicorn-0.30.5-py3-none-any.whl (62 kB)
Collecting orjson~=3.0
  Using cached orjson-3.10.7-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (141 kB)
Collecting pillow<11.0,>=8.0
  Using cached pillow-10.4.0-cp39-cp39-manylinux_2_28_x86_64.whl (4.5 MB)
Collecting aiofiles<24.0,>=22.0
  Using cached aiofiles-23.2.1-py3-none-any.whl (15 kB)
Collecting pydantic>=2.0
  Using cached pydantic-2.8.2-py3-none-any.whl (423 kB)
Collecting python-multipart>=0.0.9
  Using cached python_multipart-0.0.9-py3-none-any.whl (22 kB)
Collecting typer<1.0,>=0.12
  Using cached typer-0.12.3-py3-none-any.whl (47 kB)
Collecting tomlkit==0.12.0
  Using cached tomlkit-0.12.0-py3-none-any.whl (37 kB)
Collecting markupsafe~=2.0
  Using cached MarkupSafe-2.1.5-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (25 kB)
Collecting ffmpy
  Using cached ffmpy-0.4.0-py3-none-any.whl (5.8 kB)
Collecting fastapi
  Using cached fastapi-0.112.0-py3-none-any.whl (93 kB)
Collecting gradio-client==1.3.0
  Using cached gradio_client-1.3.0-py3-none-any.whl (318 kB)
Collecting httpx>=0.24.1
  Using cached httpx-0.27.0-py3-none-any.whl (75 kB)
Collecting semantic-version~=2.0
  Using cached semantic_version-2.10.0-py2.py3-none-any.whl (15 kB)
Collecting typing-extensions~=4.0
  Using cached typing_extensions-4.12.2-py3-none-any.whl (37 kB)
Collecting fsspec
  Using cached fsspec-2024.6.1-py3-none-any.whl (177 kB)
Collecting websockets<13.0,>=10.0
  Using cached websockets-12.0-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl (130 kB)
Collecting nvidia-cuda-cupti-cu12==12.1.105
  Using cached nvidia_cuda_cupti_cu12-12.1.105-py3-none-manylinux1_x86_64.whl (14.1 MB)
Collecting nvidia-cudnn-cu12==9.1.0.70
  Using cached nvidia_cudnn_cu12-9.1.0.70-py3-none-manylinux2014_x86_64.whl (664.8 MB)
Collecting networkx
  Using cached networkx-3.2.1-py3-none-any.whl (1.6 MB)
Collecting nvidia-cublas-cu12==12.1.3.1
  Using cached nvidia_cublas_cu12-12.1.3.1-py3-none-manylinux1_x86_64.whl (410.6 MB)
Collecting triton==3.0.0
  Using cached triton-3.0.0-1-cp39-cp39-manylinux2014_x86_64.manylinux_2_17_x86_64.whl (209.4 MB)
Collecting nvidia-cufft-cu12==11.0.2.54
  Using cached nvidia_cufft_cu12-11.0.2.54-py3-none-manylinux1_x86_64.whl (121.6 MB)
Collecting nvidia-cuda-runtime-cu12==12.1.105
  Using cached nvidia_cuda_runtime_cu12-12.1.105-py3-none-manylinux1_x86_64.whl (823 kB)
Collecting nvidia-cusparse-cu12==12.1.0.106
  Using cached nvidia_cusparse_cu12-12.1.0.106-py3-none-manylinux1_x86_64.whl (196.0 MB)
Collecting nvidia-nccl-cu12==2.20.5
  Using cached nvidia_nccl_cu12-2.20.5-py3-none-manylinux2014_x86_64.whl (176.2 MB)
Collecting nvidia-cusolver-cu12==11.4.5.107
  Using cached nvidia_cusolver_cu12-11.4.5.107-py3-none-manylinux1_x86_64.whl (124.2 MB)
Collecting nvidia-curand-cu12==10.3.2.106
  Using cached nvidia_curand_cu12-10.3.2.106-py3-none-manylinux1_x86_64.whl (56.5 MB)
Collecting nvidia-cuda-nvrtc-cu12==12.1.105
  Using cached nvidia_cuda_nvrtc_cu12-12.1.105-py3-none-manylinux1_x86_64.whl (23.7 MB)
Collecting nvidia-nvtx-cu12==12.1.105
  Using cached nvidia_nvtx_cu12-12.1.105-py3-none-manylinux1_x86_64.whl (99 kB)
Collecting filelock
  Using cached filelock-3.15.4-py3-none-any.whl (16 kB)
Collecting sympy
  Using cached sympy-1.13.1-py3-none-any.whl (6.2 MB)
Collecting nvidia-nvjitlink-cu12
  Using cached nvidia_nvjitlink_cu12-12.6.20-py3-none-manylinux2014_x86_64.whl (19.7 MB)
Collecting pygments<3.0.0,>=2.13.0
  Using cached pygments-2.18.0-py3-none-any.whl (1.2 MB)
Collecting markdown-it-py>=2.2.0
  Using cached markdown_it_py-3.0.0-py3-none-any.whl (87 kB)
Collecting scikit-image>=0.19
  Using cached scikit_image-0.24.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (14.9 MB)
Collecting protobuf>=3.20.2
  Using cached protobuf-5.27.3-cp38-abi3-manylinux2014_x86_64.whl (309 kB)
Collecting markdown>=2.6.8
  Using cached Markdown-3.6-py3-none-any.whl (105 kB)
Collecting six>1.9
  Using cached six-1.16.0-py2.py3-none-any.whl (11 kB)
Collecting grpcio>=1.48.2
  Using cached grpcio-1.65.4-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (5.7 MB)
Requirement already satisfied: setuptools>=41.0.0 in ./.venv/lib/python3.9/site-packages (from tensorboard->-r requirements.txt (line 22)) (58.1.0)
Collecting absl-py>=0.4
  Using cached absl_py-2.1.0-py3-none-any.whl (133 kB)
Collecting tensorboard-data-server<0.8.0,>=0.7.0
  Using cached tensorboard_data_server-0.7.2-py3-none-manylinux_2_31_x86_64.whl (6.6 MB)
Collecting protobuf>=3.20.2
  Using cached protobuf-4.25.4-cp37-abi3-manylinux2014_x86_64.whl (294 kB)
Collecting tokenizers<0.20,>=0.19
  Using cached tokenizers-0.19.1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (3.6 MB)
Collecting requests
  Using cached requests-2.32.3-py3-none-any.whl (64 kB)
Collecting safetensors>=0.4.1
  Using cached safetensors-0.4.4-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (436 kB)
Collecting aiohttp>=3.8.0
  Using cached aiohttp-3.10.3-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.2 MB)
Collecting certifi>=2023.11.17
  Using cached certifi-2024.7.4-py3-none-any.whl (162 kB)
Collecting aiohappyeyeballs>=2.3.0
  Using cached aiohappyeyeballs-2.3.5-py3-none-any.whl (12 kB)
Collecting attrs>=17.3.0
  Using cached attrs-24.2.0-py3-none-any.whl (63 kB)
Collecting async-timeout<5.0,>=4.0
  Using cached async_timeout-4.0.3-py3-none-any.whl (5.7 kB)
Collecting frozenlist>=1.1.1
  Using cached frozenlist-1.4.1-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl (240 kB)
Collecting yarl<2.0,>=1.0
  Using cached yarl-1.9.4-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (304 kB)
Collecting aiosignal>=1.1.2
  Using cached aiosignal-1.3.1-py3-none-any.whl (7.6 kB)
Collecting multidict<7.0,>=4.5
  Using cached multidict-6.0.5-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (123 kB)
Collecting sniffio>=1.1
  Using cached sniffio-1.3.1-py3-none-any.whl (10 kB)
Collecting idna>=2.8
  Using cached idna-3.7-py3-none-any.whl (66 kB)
Collecting exceptiongroup>=1.0.2
  Using cached exceptiongroup-1.2.2-py3-none-any.whl (16 kB)
Collecting pycparser
  Using cached pycparser-2.22-py3-none-any.whl (117 kB)
Collecting httpcore==1.*
  Using cached httpcore-1.0.5-py3-none-any.whl (77 kB)
Collecting h11<0.15,>=0.13
  Using cached h11-0.14.0-py3-none-any.whl (58 kB)
Collecting antlr4-python3-runtime==4.8
  Using cached antlr4-python3-runtime-4.8.tar.gz (112 kB)
  Preparing metadata (setup.py): started
  Preparing metadata (setup.py): finished with status 'done'
Collecting zipp>=0.5
  Using cached zipp-3.19.2-py3-none-any.whl (9.0 kB)
Collecting mdurl~=0.1
  Using cached mdurl-0.1.2-py3-none-any.whl (10.0 kB)
Collecting pyparsing>=2.3.1
  Using cached pyparsing-3.1.2-py3-none-any.whl (103 kB)
Collecting kiwisolver>=1.3.1
  Using cached kiwisolver-1.4.5-cp39-cp39-manylinux_2_12_x86_64.manylinux2010_x86_64.whl (1.6 MB)
Collecting contourpy>=1.0.1
  Using cached contourpy-1.2.1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (304 kB)
Collecting python-dateutil>=2.7
  Using cached python_dateutil-2.9.0.post0-py2.py3-none-any.whl (229 kB)
Collecting fonttools>=4.22.0
  Using cached fonttools-4.53.1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (4.6 MB)
Collecting cycler>=0.10
  Using cached cycler-0.12.1-py3-none-any.whl (8.3 kB)
Collecting llvmlite<0.44,>=0.43.0dev0
  Using cached llvmlite-0.43.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (43.9 MB)
Collecting pytz>=2020.1
  Using cached pytz-2024.1-py2.py3-none-any.whl (505 kB)
Collecting tzdata>=2022.7
  Using cached tzdata-2024.1-py2.py3-none-any.whl (345 kB)
Collecting platformdirs>=2.5.0
  Using cached platformdirs-4.2.2-py3-none-any.whl (18 kB)
Collecting pydantic-core==2.20.1
  Using cached pydantic_core-2.20.1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (2.1 MB)
Collecting annotated-types>=0.4.0
  Using cached annotated_types-0.7.0-py3-none-any.whl (13 kB)
Collecting charset-normalizer<4,>=2
  Using cached charset_normalizer-3.3.2-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (142 kB)
Collecting lxml
  Using cached lxml-5.3.0-cp39-cp39-manylinux_2_28_x86_64.whl (5.0 MB)
Collecting colorama
  Using cached colorama-0.4.6-py2.py3-none-any.whl (25 kB)
Collecting portalocker
  Using cached portalocker-2.10.1-py3-none-any.whl (18 kB)
Collecting tabulate>=0.8.9
  Using cached tabulate-0.9.0-py3-none-any.whl (35 kB)
Collecting tifffile>=2022.8.12
  Using cached tifffile-2024.7.24-py3-none-any.whl (226 kB)
Collecting lazy-loader>=0.4
  Using cached lazy_loader-0.4-py3-none-any.whl (12 kB)
Collecting imageio>=2.33
  Using cached imageio-2.34.2-py3-none-any.whl (313 kB)
Collecting threadpoolctl>=3.1.0
  Using cached threadpoolctl-3.5.0-py3-none-any.whl (18 kB)
Collecting shellingham>=1.3.0
  Using cached shellingham-1.5.4-py2.py3-none-any.whl (9.8 kB)
Collecting starlette<0.38.0,>=0.37.2
  Using cached starlette-0.37.2-py3-none-any.whl (71 kB)
Collecting mpmath<1.4,>=1.1.0
  Using cached mpmath-1.3.0-py3-none-any.whl (536 kB)
Installing collected packages: pytz, pydub, mpmath, bitarray, antlr4-python3-runtime, zipp, websockets, urllib3, tzdata, typing-extensions, tqdm, tomlkit, threadpoolctl, tensorboard-data-server, tabulate, sympy, sniffio, six, shellingham, semantic-version, safetensors, ruff, regex, pyyaml, python-multipart, pyparsing, pynvml, pygments, pycparser, protobuf, portalocker, platformdirs, pillow, packaging, orjson, nvidia-nvtx-cu12, nvidia-nvjitlink-cu12, nvidia-nccl-cu12, nvidia-curand-cu12, nvidia-cufft-cu12, nvidia-cuda-runtime-cu12, nvidia-cuda-nvrtc-cu12, nvidia-cuda-cupti-cu12, nvidia-cublas-cu12, numpy, networkx, multidict, mdurl, markupsafe, lxml, loguru, llvmlite, kiwisolver, joblib, itsdangerous, idna, h11, grpcio, future, fsspec, frozenlist, fonttools, filelock, ffmpy, exceptiongroup, einops, decorator, cython, cycler, colorama, click, charset-normalizer, certifi, blinker, audioread, attrs, async-timeout, annotated-types, aiohappyeyeballs, aiofiles, absl-py, yarl, Werkzeug, uvicorn, triton, tifffile, tensorboardX, scipy, sacrebleu, requests, pyworld, python-dateutil, pydantic-core, praat-parselmouth, onnx, omegaconf, nvidia-cusparse-cu12, nvidia-cudnn-cu12, numba, markdown-it-py, lazy-loader, langdetect, Jinja2, importlib-resources, importlib-metadata, imageio, httpcore, ffmpeg-python, faiss-cpu, contourpy, cffi, anyio, aiosignal, starlette, SoundFile, scikit-learn, scikit-image, rich, resampy, pydantic, pooch, pandas, onnxoptimizer, nvidia-cusolver-cu12, matplotlib, markdown, hydra-core, huggingface-hub, httpx, Flask, aiohttp, typer, torch, tokenizers, tensorboard, scikit-maad, onnxsim, librosa, gradio-client, Flask_Cors, fastapi, edge_tts, transformers, torchaudio, local_attention, gradio, torchcrepe, fairseq
  DEPRECATION: antlr4-python3-runtime is being installed using the legacy 'setup.py install' method, because it does not have a 'pyproject.toml' and the 'wheel' package is not installed. pip 23.1 will enforce this behaviour change. A possible replacement is to enable the '--use-pep517' option. Discussion can be found at https://github.com/pypa/pip/issues/8559
  Running setup.py install for antlr4-python3-runtime: started
  Running setup.py install for antlr4-python3-runtime: finished with status 'done'
  Attempting uninstall: numpy
    Found existing installation: numpy 1.26.4
    Not uninstalling numpy at /nix/store/x1r39izq1hzjz5qyz7mrw81wiwdj1rrc-python3.9-numpy-1.26.4/lib/python3.9/site-packages, outside environment /home/nahida/Private/so/.venv
    Can't uninstall 'numpy'. No files were found to uninstall.
  DEPRECATION: langdetect is being installed using the legacy 'setup.py install' method, because it does not have a 'pyproject.toml' and the 'wheel' package is not installed. pip 23.1 will enforce this behaviour change. A possible replacement is to enable the '--use-pep517' option. Discussion can be found at https://github.com/pypa/pip/issues/8559
  Running setup.py install for langdetect: started
  Running setup.py install for langdetect: finished with status 'done'
Successfully installed Flask-3.0.3 Flask_Cors-4.0.1 Jinja2-3.1.4 SoundFile-0.12.1 Werkzeug-3.0.3 absl-py-2.1.0 aiofiles-23.2.1 aiohappyeyeballs-2.3.5 aiohttp-3.10.3 aiosignal-1.3.1 annotated-types-0.7.0 antlr4-python3-runtime-4.8 anyio-4.4.0 async-timeout-4.0.3 attrs-24.2.0 audioread-3.0.1 bitarray-2.9.2 blinker-1.8.2 certifi-2024.7.4 cffi-1.17.0 charset-normalizer-3.3.2 click-8.1.7 colorama-0.4.6 contourpy-1.2.1 cycler-0.12.1 cython-3.0.11 decorator-5.1.1 edge_tts-6.1.12 einops-0.8.0 exceptiongroup-1.2.2 fairseq-0.12.2 faiss-cpu-1.8.0.post1 fastapi-0.112.0 ffmpeg-python-0.2.0 ffmpy-0.4.0 filelock-3.15.4 fonttools-4.53.1 frozenlist-1.4.1 fsspec-2024.6.1 future-1.0.0 gradio-4.41.0 gradio-client-1.3.0 grpcio-1.65.4 h11-0.14.0 httpcore-1.0.5 httpx-0.27.0 huggingface-hub-0.24.5 hydra-core-1.0.7 idna-3.7 imageio-2.34.2 importlib-metadata-8.2.0 importlib-resources-6.4.0 itsdangerous-2.2.0 joblib-1.4.2 kiwisolver-1.4.5 langdetect-1.0.9 lazy-loader-0.4 librosa-0.9.1 llvmlite-0.43.0 local_attention-1.9.14 loguru-0.7.2 lxml-5.3.0 markdown-3.6 markdown-it-py-3.0.0 markupsafe-2.1.5 matplotlib-3.9.1.post1 mdurl-0.1.2 mpmath-1.3.0 multidict-6.0.5 networkx-3.2.1 numba-0.60.0 numpy-1.23.5 nvidia-cublas-cu12-12.1.3.1 nvidia-cuda-cupti-cu12-12.1.105 nvidia-cuda-nvrtc-cu12-12.1.105 nvidia-cuda-runtime-cu12-12.1.105 nvidia-cudnn-cu12-9.1.0.70 nvidia-cufft-cu12-11.0.2.54 nvidia-curand-cu12-10.3.2.106 nvidia-cusolver-cu12-11.4.5.107 nvidia-cusparse-cu12-12.1.0.106 nvidia-nccl-cu12-2.20.5 nvidia-nvjitlink-cu12-12.6.20 nvidia-nvtx-cu12-12.1.105 omegaconf-2.0.6 onnx-1.16.2 onnxoptimizer-0.3.13 onnxsim-0.4.36 orjson-3.10.7 packaging-24.1 pandas-2.2.2 pillow-10.4.0 platformdirs-4.2.2 pooch-1.8.2 portalocker-2.10.1 praat-parselmouth-0.4.4 protobuf-4.25.4 pycparser-2.22 pydantic-2.8.2 pydantic-core-2.20.1 pydub-0.25.1 pygments-2.18.0 pynvml-11.5.3 pyparsing-3.1.2 python-dateutil-2.9.0.post0 python-multipart-0.0.9 pytz-2024.1 pyworld-0.3.4 pyyaml-6.0.2 regex-2024.7.24 requests-2.32.3 resampy-0.4.3 rich-13.7.1 ruff-0.5.7 sacrebleu-2.4.2 safetensors-0.4.4 scikit-image-0.24.0 scikit-learn-1.5.1 scikit-maad-1.4.3 scipy-1.10.0 semantic-version-2.10.0 shellingham-1.5.4 six-1.16.0 sniffio-1.3.1 starlette-0.37.2 sympy-1.13.1 tabulate-0.9.0 tensorboard-2.17.0 tensorboard-data-server-0.7.2 tensorboardX-2.6.2.2 threadpoolctl-3.5.0 tifffile-2024.7.24 tokenizers-0.19.1 tomlkit-0.12.0 torch-2.4.0 torchaudio-2.4.0 torchcrepe-0.0.23 tqdm-4.66.5 transformers-4.44.0 triton-3.0.0 typer-0.12.3 typing-extensions-4.12.2 tzdata-2024.1 urllib3-2.2.2 uvicorn-0.30.5 websockets-12.0 yarl-1.9.4 zipp-3.19.2

[notice] A new release of pip is available: 23.0.1 -> 24.2
[notice] To update, run: pip install --upgrade pip

转换段音频试试:

BASH
1
python inference_main.py -m logs/44k/nahida_G_40000.pth -c configs/nahida.json -t 0 -s nahida -cm logs/44k/nahida_kmeans_10000.pt -cr 0.5 -n test.wav -f0p harvest -t 10
输出
TEXT
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
111
112
113
114
115
116
117
118
119
120
121
122
123
124
/home/nahida/Private/so-vits-svc/.venv/lib/python3.9/site-packages/torch/nn/utils/weight_norm.py:134: FutureWarning: `torch.nn.utils.weight_norm` is deprecated in favor of `torch.nn.utils.parametrizations.weight_norm`.
  WeightNorm.apply(module, name, dim)
/home/nahida/Private/so-vits-svc/utils.py:157: FutureWarning: You are using `torch.load` with `weights_only=False` (the current default value), which uses the default pickle module implicitly. It is possible to construct malicious pickle data which will execute arbitrary code during unpickling (See https://github.com/pytorch/pytorch/blob/main/SECURITY.md#untrusted-models for more details). In a future release, the default value for `weights_only` will be flipped to `True`. This limits the functions that could be executed during unpickling. Arbitrary objects will no longer be allowed to be loaded via this mode unless they are explicitly allowlisted by the user via `torch.serialization.add_safe_globals`. We recommend you start setting `weights_only=True` for any use case where you don't have full control of the loaded file. Please open an issue on GitHub for any issues related to this experimental feature.
  checkpoint_dict = torch.load(checkpoint_path, map_location='cpu')
/home/nahida/Private/so-vits-svc/.venv/lib/python3.9/site-packages/fairseq/checkpoint_utils.py:315: FutureWarning: You are using `torch.load` with `weights_only=False` (the current default value), which uses the default pickle module implicitly. It is possible to construct malicious pickle data which will execute arbitrary code during unpickling (See https://github.com/pytorch/pytorch/blob/main/SECURITY.md#untrusted-models for more details). In a future release, the default value for `weights_only` will be flipped to `True`. This limits the functions that could be executed during unpickling. Arbitrary objects will no longer be allowed to be loaded via this mode unless they are explicitly allowlisted by the user via `torch.serialization.add_safe_globals`. We recommend you start setting `weights_only=True` for any use case where you don't have full control of the loaded file. Please open an issue on GitHub for any issues related to this experimental feature.
  state = torch.load(f, map_location=torch.device("cpu"))
/home/nahida/Private/so-vits-svc/.venv/lib/python3.9/site-packages/torch/nn/utils/weight_norm.py:134: FutureWarning: `torch.nn.utils.weight_norm` is deprecated in favor of `torch.nn.utils.parametrizations.weight_norm`.
  WeightNorm.apply(module, name, dim)
/home/nahida/Private/so-vits-svc/cluster/__init__.py:6: FutureWarning: You are using `torch.load` with `weights_only=False` (the current default value), which uses the default pickle module implicitly. It is possible to construct malicious pickle data which will execute arbitrary code during unpickling (See https://github.com/pytorch/pytorch/blob/main/SECURITY.md#untrusted-models for more details). In a future release, the default value for `weights_only` will be flipped to `True`. This limits the functions that could be executed during unpickling. Arbitrary objects will no longer be allowed to be loaded via this mode unless they are explicitly allowlisted by the user via `torch.serialization.add_safe_globals`. We recommend you start setting `weights_only=True` for any use case where you don't have full control of the loaded file. Please open an issue on GitHub for any issues related to this experimental feature.
  checkpoint = torch.load(ckpt_path)
/home/nahida/Private/so-vits-svc/inference/infer_tool.py:270: UserWarning: torchaudio._backend.set_audio_backend has been deprecated. With dispatcher enabled, this function is no-op. You can remove the function call.
  torchaudio.set_audio_backend("soundfile")
/home/nahida/Private/so-vits-svc/inference/infer_tool.py:270: UserWarning: torchaudio._backend.set_audio_backend has been deprecated. With dispatcher enabled, this function is no-op. You can remove the function call.
  torchaudio.set_audio_backend("soundfile")
/home/nahida/Private/so-vits-svc/inference/infer_tool.py:270: UserWarning: torchaudio._backend.set_audio_backend has been deprecated. With dispatcher enabled, this function is no-op. You can remove the function call.
  torchaudio.set_audio_backend("soundfile")
/home/nahida/Private/so-vits-svc/inference/infer_tool.py:270: UserWarning: torchaudio._backend.set_audio_backend has been deprecated. With dispatcher enabled, this function is no-op. You can remove the function call.
  torchaudio.set_audio_backend("soundfile")
/home/nahida/Private/so-vits-svc/inference/infer_tool.py:270: UserWarning: torchaudio._backend.set_audio_backend has been deprecated. With dispatcher enabled, this function is no-op. You can remove the function call.
  torchaudio.set_audio_backend("soundfile")
/home/nahida/Private/so-vits-svc/inference/infer_tool.py:270: UserWarning: torchaudio._backend.set_audio_backend has been deprecated. With dispatcher enabled, this function is no-op. You can remove the function call.
  torchaudio.set_audio_backend("soundfile")
/home/nahida/Private/so-vits-svc/inference/infer_tool.py:270: UserWarning: torchaudio._backend.set_audio_backend has been deprecated. With dispatcher enabled, this function is no-op. You can remove the function call.
  torchaudio.set_audio_backend("soundfile")
/home/nahida/Private/so-vits-svc/inference/infer_tool.py:270: UserWarning: torchaudio._backend.set_audio_backend has been deprecated. With dispatcher enabled, this function is no-op. You can remove the function call.
  torchaudio.set_audio_backend("soundfile")
/home/nahida/Private/so-vits-svc/inference/infer_tool.py:270: UserWarning: torchaudio._backend.set_audio_backend has been deprecated. With dispatcher enabled, this function is no-op. You can remove the function call.
  torchaudio.set_audio_backend("soundfile")
/home/nahida/Private/so-vits-svc/inference/infer_tool.py:270: UserWarning: torchaudio._backend.set_audio_backend has been deprecated. With dispatcher enabled, this function is no-op. You can remove the function call.
  torchaudio.set_audio_backend("soundfile")
/home/nahida/Private/so-vits-svc/inference/infer_tool.py:270: UserWarning: torchaudio._backend.set_audio_backend has been deprecated. With dispatcher enabled, this function is no-op. You can remove the function call.
  torchaudio.set_audio_backend("soundfile")
/home/nahida/Private/so-vits-svc/inference/infer_tool.py:270: UserWarning: torchaudio._backend.set_audio_backend has been deprecated. With dispatcher enabled, this function is no-op. You can remove the function call.
  torchaudio.set_audio_backend("soundfile")
/home/nahida/Private/so-vits-svc/inference/infer_tool.py:270: UserWarning: torchaudio._backend.set_audio_backend has been deprecated. With dispatcher enabled, this function is no-op. You can remove the function call.
  torchaudio.set_audio_backend("soundfile")
/home/nahida/Private/so-vits-svc/inference/infer_tool.py:270: UserWarning: torchaudio._backend.set_audio_backend has been deprecated. With dispatcher enabled, this function is no-op. You can remove the function call.
  torchaudio.set_audio_backend("soundfile")
/home/nahida/Private/so-vits-svc/inference/infer_tool.py:270: UserWarning: torchaudio._backend.set_audio_backend has been deprecated. With dispatcher enabled, this function is no-op. You can remove the function call.
  torchaudio.set_audio_backend("soundfile")
/home/nahida/Private/so-vits-svc/inference/infer_tool.py:270: UserWarning: torchaudio._backend.set_audio_backend has been deprecated. With dispatcher enabled, this function is no-op. You can remove the function call.
  torchaudio.set_audio_backend("soundfile")
/home/nahida/Private/so-vits-svc/inference/infer_tool.py:270: UserWarning: torchaudio._backend.set_audio_backend has been deprecated. With dispatcher enabled, this function is no-op. You can remove the function call.
  torchaudio.set_audio_backend("soundfile")
/home/nahida/Private/so-vits-svc/inference/infer_tool.py:270: UserWarning: torchaudio._backend.set_audio_backend has been deprecated. With dispatcher enabled, this function is no-op. You can remove the function call.
  torchaudio.set_audio_backend("soundfile")
/home/nahida/Private/so-vits-svc/inference/infer_tool.py:270: UserWarning: torchaudio._backend.set_audio_backend has been deprecated. With dispatcher enabled, this function is no-op. You can remove the function call.
  torchaudio.set_audio_backend("soundfile")
/home/nahida/Private/so-vits-svc/inference/infer_tool.py:270: UserWarning: torchaudio._backend.set_audio_backend has been deprecated. With dispatcher enabled, this function is no-op. You can remove the function call.
  torchaudio.set_audio_backend("soundfile")
/home/nahida/Private/so-vits-svc/inference/infer_tool.py:270: UserWarning: torchaudio._backend.set_audio_backend has been deprecated. With dispatcher enabled, this function is no-op. You can remove the function call.
  torchaudio.set_audio_backend("soundfile")
/home/nahida/Private/so-vits-svc/inference/infer_tool.py:270: UserWarning: torchaudio._backend.set_audio_backend has been deprecated. With dispatcher enabled, this function is no-op. You can remove the function call.
  torchaudio.set_audio_backend("soundfile")
/home/nahida/Private/so-vits-svc/inference/infer_tool.py:270: UserWarning: torchaudio._backend.set_audio_backend has been deprecated. With dispatcher enabled, this function is no-op. You can remove the function call.
  torchaudio.set_audio_backend("soundfile")
/home/nahida/Private/so-vits-svc/inference/infer_tool.py:270: UserWarning: torchaudio._backend.set_audio_backend has been deprecated. With dispatcher enabled, this function is no-op. You can remove the function call.
  torchaudio.set_audio_backend("soundfile")
/home/nahida/Private/so-vits-svc/inference/infer_tool.py:270: UserWarning: torchaudio._backend.set_audio_backend has been deprecated. With dispatcher enabled, this function is no-op. You can remove the function call.
  torchaudio.set_audio_backend("soundfile")
/home/nahida/Private/so-vits-svc/inference/infer_tool.py:270: UserWarning: torchaudio._backend.set_audio_backend has been deprecated. With dispatcher enabled, this function is no-op. You can remove the function call.
  torchaudio.set_audio_backend("soundfile")
/home/nahida/Private/so-vits-svc/inference/infer_tool.py:270: UserWarning: torchaudio._backend.set_audio_backend has been deprecated. With dispatcher enabled, this function is no-op. You can remove the function call.
  torchaudio.set_audio_backend("soundfile")
load
load model(s) from pretrain/checkpoint_best_legacy_500.pt
#=====segment start, 7.66s======
jump empty segment
#=====segment start, 5.42s======
vits use time:3.462442636489868
#=====segment start, 5.9s======
vits use time:4.255711317062378
#=====segment start, 4.94s======
vits use time:1.9070079326629639
#=====segment start, 6.3s======
vits use time:2.5270442962646484
#=====segment start, 7.2s======
vits use time:3.1404824256896973
#=====segment start, 6.94s======
vits use time:2.893730640411377
#=====segment start, 4.98s======
vits use time:1.820495367050171
#=====segment start, 6.52s======
vits use time:2.7841036319732666
#=====segment start, 6.34s======
vits use time:2.4262890815734863
#=====segment start, 5.06s======
vits use time:2.149042844772339
#=====segment start, 5.06s======
vits use time:1.7513980865478516
#=====segment start, 6.06s======
vits use time:2.255300521850586
#=====segment start, 5.98s======
vits use time:2.4708659648895264
#=====segment start, 7.16s======
vits use time:4.472574234008789
#=====segment start, 3.7s======
vits use time:1.3285341262817383
#=====segment start, 4.62s======
vits use time:1.6644704341888428
#=====segment start, 5.5s======
vits use time:1.9458322525024414
#=====segment start, 4.84s======
vits use time:2.021371841430664
#=====segment start, 5.3s======
vits use time:2.7036304473876953
#=====segment start, 8.72s======
vits use time:5.952747821807861
#=====segment start, 5.14s======
vits use time:3.238168478012085
#=====segment start, 5.1s======
vits use time:3.3194198608398438
#=====segment start, 6.16s======
vits use time:2.434461832046509
#=====segment start, 4.48s======
vits use time:1.6480510234832764
#=====segment start, 8.44s======
vits use time:5.4331159591674805
#=====segment start, 6.92s======
vits use time:2.6755127906799316
#=====segment start, 4.58s======
vits use time:2.949699640274048
#=====segment start, 0.269s======
jump empty segment

全文完。