bzd4576 commited on
Commit
e365884
·
1 Parent(s): f267438

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -52,7 +52,7 @@ hubert = torch.hub.load("bshall/hubert:main", "hubert_soft")
52
 
53
  _ = utils.load_checkpoint("G_18000.pth", net_g_ms, None)
54
 
55
- def vc_fn(input_audio,vc_transform,vcid):
56
  if input_audio is None:
57
  return "You need to upload an audio", None
58
  sampling_rate, audio = input_audio
@@ -77,7 +77,7 @@ def vc_fn(input_audio,vc_transform,vcid):
77
  print(sampling_rate)
78
  f0 = resize2d(f0, len(soft[:, 0])) * vc_transform
79
  soft[:, 0] = f0 / 10
80
- sid = torch.LongTensor([vcid])
81
  stn_tst = torch.FloatTensor(soft)
82
  with torch.no_grad():
83
  x_tst = stn_tst.unsqueeze(0)
@@ -94,7 +94,7 @@ with app:
94
  with gr.TabItem("Basic"):
95
  vc_input3 = gr.Audio(label="Input Audio (30s limitation)")
96
  vc_transform = gr.Number(label="transform",value=1.0)
97
- vcid = gr.Textbox(vcid, default=0, label=speakerID)
98
  vc_submit = gr.Button("Convert", variant="primary")
99
  vc_output1 = gr.Textbox(label="Output Message")
100
  vc_output2 = gr.Audio(label="Output Audio")
 
52
 
53
  _ = utils.load_checkpoint("G_18000.pth", net_g_ms, None)
54
 
55
+ def vc_fn(input_audio,vc_transform):
56
  if input_audio is None:
57
  return "You need to upload an audio", None
58
  sampling_rate, audio = input_audio
 
77
  print(sampling_rate)
78
  f0 = resize2d(f0, len(soft[:, 0])) * vc_transform
79
  soft[:, 0] = f0 / 10
80
+ sid = torch.LongTensor([0])
81
  stn_tst = torch.FloatTensor(soft)
82
  with torch.no_grad():
83
  x_tst = stn_tst.unsqueeze(0)
 
94
  with gr.TabItem("Basic"):
95
  vc_input3 = gr.Audio(label="Input Audio (30s limitation)")
96
  vc_transform = gr.Number(label="transform",value=1.0)
97
+ vcid = gr.Textbox(label="id",value=1)
98
  vc_submit = gr.Button("Convert", variant="primary")
99
  vc_output1 = gr.Textbox(label="Output Message")
100
  vc_output2 = gr.Audio(label="Output Audio")