Spaces:
Running on Zero
Running on Zero
Update src/rvc.py
Browse files16 unmodified lines171819202122232425262741 unmodified lines69707172737416 unmodified linesBASE_DIR = Path(__file__).resolve().parent.parentclass Config:def __init__(self, device, is_half):self.device = deviceself.is_half = is_halfself.n_cpu = 0self.gpu_name = Noneself.gpu_mem = Noneself.x_pad, self.x_query, self.x_center, self.x_max = self.device_config()41 unmodified linesprint("No supported N-card found, use CPU for inference")self.device = "cpu"self.is_half = Trueif self.n_cpu == 0:self.n_cpu = cpu_count()16 unmodified lines1718192021222324252627282930313233343536373839404141 unmodified lines8384858687888916 unmodified linesBASE_DIR = Path(__file__).resolve().parent.parent# config cpudef use_fp32_config():for config_file in ["32k.json","40k.json","48k.json","48k_v2.json","32k_v2.json",]:with open(f"configs/{config_file}", "r") as f:strr = f.read().replace("true", "false")with open(f"configs/{config_file}", "w") as f:f.write(strr)class Config:def __init__(self, device, is_half):self.device = deviceself.is_half = is_halfself.n_cpu = 2 # set cpu coresself.gpu_name = Noneself.gpu_mem = Noneself.x_pad, self.x_query, self.x_center, self.x_max = self.device_config()41 unmodified linesprint("No supported N-card found, use CPU for inference")self.device = "cpu"self.is_half = Trueuse_fp32_config() # cpu configif self.n_cpu == 0:self.n_cpu = cpu_count()
src/rvc.py+16-1