kevinwang676 commited on
Commit
d0fccb9
·
verified ·
1 Parent(s): dcdada6

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +17 -2
app.py CHANGED
@@ -348,7 +348,8 @@ def combine_vocal_and_inst(model_name, song_name, song_id, split_model, cover_so
348
  result = subprocess.run(command.split(), stdout=subprocess.PIPE)
349
  print(result.stdout.decode())
350
  return output_path
351
-
 
352
  global hubert_model
353
  @spaces.GPU(duration=10)
354
  def load_hubert():
@@ -371,6 +372,7 @@ def load_hubert():
371
  #hubert_model = load_hubert()
372
  load_hubert()
373
  print(hubert_model)
 
374
 
375
  def rvc_models(model_name):
376
  global vc, net_g, index_files, tgt_sr, version
@@ -425,8 +427,21 @@ def rvc_models(model_name):
425
 
426
  singers="您的专属AI歌手阵容:"
427
 
428
- @spaces.GPU(duration=60)
429
  def infer_gpu(hubert_model, net_g, audio, f0_up_key, index_file, tgt_sr, version, f0_file=None):
 
 
 
 
 
 
 
 
 
 
 
 
 
430
  return vc.pipeline(
431
  hubert_model,
432
  net_g,
 
348
  result = subprocess.run(command.split(), stdout=subprocess.PIPE)
349
  print(result.stdout.decode())
350
  return output_path
351
+
352
+ '''
353
  global hubert_model
354
  @spaces.GPU(duration=10)
355
  def load_hubert():
 
372
  #hubert_model = load_hubert()
373
  load_hubert()
374
  print(hubert_model)
375
+ '''
376
 
377
  def rvc_models(model_name):
378
  global vc, net_g, index_files, tgt_sr, version
 
427
 
428
  singers="您的专属AI歌手阵容:"
429
 
430
+ @spaces.GPU(duration=80)
431
  def infer_gpu(hubert_model, net_g, audio, f0_up_key, index_file, tgt_sr, version, f0_file=None):
432
+ from fairseq import checkpoint_utils
433
+ models, _, _ = checkpoint_utils.load_model_ensemble_and_task(
434
+ ["hubert_base.pt"],
435
+ suffix="",
436
+ )
437
+ hubert_model = models[0]
438
+ hubert_model = hubert_model.to(config.device)
439
+ if config.is_half:
440
+ hubert_model = hubert_model.half()
441
+ else:
442
+ hubert_model = hubert_model.float()
443
+ hubert_model.eval()
444
+
445
  return vc.pipeline(
446
  hubert_model,
447
  net_g,