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

Update src/main.py

Browse files
Files changed (1) hide show
  1. src/main.py +6 -1
src/main.py CHANGED
@@ -45,7 +45,12 @@ def display_progress(percent, message, progress=gr.Progress()):
45
 
46
  def voice_change(voice_model, vocals_path, output_path, pitch_change, f0_method, index_rate, filter_radius, rms_mix_rate, protect, crepe_hop_length):
47
  rvc_model_path, rvc_index_path = get_rvc_model(voice_model)
48
- device = 'cpu'
 
 
 
 
 
49
  config = Config(device, True)
50
  hubert_model = load_hubert(device, config.is_half, os.path.join(RVC_MODELS_DIR, 'hubert_base.pt'))
51
  cpt, version, net_g, tgt_sr, vc = get_vc(device, config.is_half, config, rvc_model_path)
 
45
 
46
  def voice_change(voice_model, vocals_path, output_path, pitch_change, f0_method, index_rate, filter_radius, rms_mix_rate, protect, crepe_hop_length):
47
  rvc_model_path, rvc_index_path = get_rvc_model(voice_model)
48
+
49
+ if torch.cuda.is_available():
50
+ device = 'cuda:0'
51
+ else:
52
+ device = 'cpu'
53
+
54
  config = Config(device, True)
55
  hubert_model = load_hubert(device, config.is_half, os.path.join(RVC_MODELS_DIR, 'hubert_base.pt'))
56
  cpt, version, net_g, tgt_sr, vc = get_vc(device, config.is_half, config, rvc_model_path)