mirror of
https://github.com/RVC-Project/Retrieval-based-Voice-Conversion-WebUI.git
synced 2025-01-21 14:00:06 +08:00
Escaping when device does not match (#203)
This commit is contained in:
parent
b12e33891c
commit
6d0ec4b00c
@ -50,7 +50,6 @@ class Config:
|
|||||||
|
|
||||||
def device_config(self) -> tuple:
|
def device_config(self) -> tuple:
|
||||||
if torch.cuda.is_available():
|
if torch.cuda.is_available():
|
||||||
self.gpu_name = torch.cuda.get_device_name(int(self.device.split(":")[-1]))
|
|
||||||
i_device = int(self.device.split(":")[-1])
|
i_device = int(self.device.split(":")[-1])
|
||||||
self.gpu_name = torch.cuda.get_device_name(i_device)
|
self.gpu_name = torch.cuda.get_device_name(i_device)
|
||||||
if (
|
if (
|
||||||
@ -76,6 +75,8 @@ class Config:
|
|||||||
with open("trainset_preprocess_pipeline_print.py", "r+") as f:
|
with open("trainset_preprocess_pipeline_print.py", "r+") as f:
|
||||||
strr = f.read().replace("3.7", "3.0")
|
strr = f.read().replace("3.7", "3.0")
|
||||||
f.write(strr)
|
f.write(strr)
|
||||||
|
else:
|
||||||
|
self.gpu_name = None
|
||||||
elif torch.backends.mps.is_available():
|
elif torch.backends.mps.is_available():
|
||||||
print("没有发现支持的N卡, 使用MPS进行推理")
|
print("没有发现支持的N卡, 使用MPS进行推理")
|
||||||
self.device = "mps"
|
self.device = "mps"
|
||||||
|
Loading…
Reference in New Issue
Block a user