kevinwang676 commited on
Commit
32ba6a2
1 Parent(s): ed9bc62

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +15 -13
app.py CHANGED
@@ -66,6 +66,21 @@ urllib.request.urlretrieve("https://download.openxlab.org.cn/models/Kevin676/rvc
66
 
67
  pattern_zip = r"/([^/]+)\.zip$"
68
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
69
  def get_file_name(url):
70
  match = re.search(pattern_zip, url)
71
  if match:
@@ -389,20 +404,7 @@ def load_hubert():
389
 
390
  load_hubert()
391
  '''
392
- from fairseq import checkpoint_utils
393
 
394
- global hubert_model
395
- models, _, _ = checkpoint_utils.load_model_ensemble_and_task(
396
- ["hubert_base.pt"],
397
- suffix="",
398
- )
399
- hubert_model = models[0]
400
- hubert_model = hubert_model.to(config.device)
401
- if config.is_half:
402
- hubert_model = hubert_model.half()
403
- else:
404
- hubert_model = hubert_model.float()
405
- hubert_model.eval()
406
 
407
  def rvc_models(model_name):
408
  global vc, net_g, index_files, tgt_sr, version
 
66
 
67
  pattern_zip = r"/([^/]+)\.zip$"
68
 
69
+ from fairseq import checkpoint_utils
70
+
71
+ global hubert_model
72
+ models, _, _ = checkpoint_utils.load_model_ensemble_and_task(
73
+ ["hubert_base.pt"],
74
+ suffix="",
75
+ )
76
+ hubert_model = models[0]
77
+ hubert_model = hubert_model.to(config.device)
78
+ if config.is_half:
79
+ hubert_model = hubert_model.half()
80
+ else:
81
+ hubert_model = hubert_model.float()
82
+ hubert_model.eval()
83
+
84
  def get_file_name(url):
85
  match = re.search(pattern_zip, url)
86
  if match:
 
404
 
405
  load_hubert()
406
  '''
 
407
 
 
 
 
 
 
 
 
 
 
 
 
 
408
 
409
  def rvc_models(model_name):
410
  global vc, net_g, index_files, tgt_sr, version