Politrees commited on
Commit
03824b2
1 Parent(s): 97bfb7b

Update src/rvc.py

Browse files
Files changed (1) hide show
  1. src/rvc.py +10 -2
src/rvc.py CHANGED
@@ -19,8 +19,8 @@ BASE_DIR = Path(__file__).resolve().parent.parent
19
 
20
  class Config:
21
  def __init__(self, device, is_half):
22
- self.device = 'cpu'
23
- self.is_half = True
24
  self.n_cpu = 0
25
  self.gpu_name = None
26
  self.gpu_mem = None
@@ -63,6 +63,14 @@ class Config:
63
  with open(BASE_DIR / "src" / "trainset_preprocess_pipeline_print.py", "w") as f:
64
  f.write(strr)
65
 
 
 
 
 
 
 
 
 
66
  if self.n_cpu == 0:
67
  self.n_cpu = cpu_count()
68
 
 
19
 
20
  class Config:
21
  def __init__(self, device, is_half):
22
+ self.device = device
23
+ self.is_half = is_half
24
  self.n_cpu = 0
25
  self.gpu_name = None
26
  self.gpu_mem = None
 
63
  with open(BASE_DIR / "src" / "trainset_preprocess_pipeline_print.py", "w") as f:
64
  f.write(strr)
65
 
66
+ elif torch.backends.mps.is_available():
67
+ print("No supported N-card found, use MPS for inference")
68
+ self.device = "mps"
69
+ else:
70
+ print("No supported N-card found, use CPU for inference")
71
+ self.device = "cpu"
72
+ self.is_half = True
73
+
74
  if self.n_cpu == 0:
75
  self.n_cpu = cpu_count()
76