bodhisativa commited on
Commit
b74bf47
·
verified ·
1 Parent(s): f40f349

Mirror lj1995/VoiceConversionWebUI @ b2c8cae96e3b — config.py

Browse files
Files changed (1) hide show
  1. config.py +38 -0
config.py ADDED
@@ -0,0 +1,38 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ############离线VC参数
2
+ inp_root=r"白鹭霜华长条"#对输入目录下所有音频进行转换,别放非音频文件
3
+ opt_root=r"opt"#输出目录
4
+ f0_up_key=0#升降调,整数,男转女12,女转男-12
5
+ person=r"weights\洛天依v3.pt"#目前只有洛天依v3
6
+ ############硬件参数
7
+ device = "cuda:0"#填写cuda:x或cpu,x指代第几张卡,只支持N卡加速
8
+ is_half=True#9-10-20-30-40系显卡无脑True,不影响质量,>=20显卡开启有加速
9
+ n_cpu=0#默认0用上所有线程,写数字限制CPU资源使用
10
+ ############下头别动
11
+ import torch
12
+ if(torch.cuda.is_available()==False):
13
+ print("没有发现支持的N卡,使用CPU进行推理")
14
+ device="cpu"
15
+ is_half=False
16
+ if(device!="cpu"):
17
+ gpu_name=torch.cuda.get_device_name(int(device.split(":")[-1]))
18
+ if("16"in gpu_name):
19
+ print("16系显卡强制单精度")
20
+ is_half=False
21
+ from multiprocessing import cpu_count
22
+ if(n_cpu==0):n_cpu=cpu_count()
23
+ if(is_half==True):
24
+ #6G显存配置
25
+ x_pad = 3
26
+ x_query = 10
27
+ x_center = 60
28
+ x_max = 65
29
+ else:
30
+ #5G显存配置
31
+ x_pad = 1
32
+ # x_query = 6
33
+ # x_center = 30
34
+ # x_max = 32
35
+ #6G显存配置
36
+ x_query = 6
37
+ x_center = 38
38
+ x_max = 41