bzd4576 commited on
Commit
8ae5ebf
·
1 Parent(s): 7da8636

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +9 -2
app.py CHANGED
@@ -52,8 +52,15 @@ 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):
56
- vcid=0
57
  if input_audio is None:
58
  return "You need to upload an audio", None
59
  sampling_rate, audio = input_audio
@@ -95,10 +102,10 @@ with app:
95
  with gr.TabItem("Basic"):
96
  vc_input3 = gr.Audio(label="Input Audio (30s limitation)")
97
  vc_transform = gr.Number(label="transform",value=1.0)
98
- vcid = gr.Textbox(label="id")
99
  vc_submit = gr.Button("Convert", variant="primary")
100
  vc_output1 = gr.Textbox(label="Output Message")
101
  vc_output2 = gr.Audio(label="Output Audio")
 
102
  vc_submit.click(vc_fn, [vc_input3, vc_transform], [vc_output1, vc_output2])
103
 
104
  app.launch()
 
52
 
53
  _ = utils.load_checkpoint("G_18000.pth", net_g_ms, None)
54
 
55
+ global vcid
56
+
57
+ def getid()
58
+ global vcid
59
+ vcid=getid
60
+ return 0
61
+
62
  def vc_fn(input_audio,vc_transform):
63
+ global vcid
64
  if input_audio is None:
65
  return "You need to upload an audio", None
66
  sampling_rate, audio = input_audio
 
102
  with gr.TabItem("Basic"):
103
  vc_input3 = gr.Audio(label="Input Audio (30s limitation)")
104
  vc_transform = gr.Number(label="transform",value=1.0)
 
105
  vc_submit = gr.Button("Convert", variant="primary")
106
  vc_output1 = gr.Textbox(label="Output Message")
107
  vc_output2 = gr.Audio(label="Output Audio")
108
+ inputs.Textbox(getid, lines=1, placeholder=None, default="0", label=id, optional=False)
109
  vc_submit.click(vc_fn, [vc_input3, vc_transform], [vc_output1, vc_output2])
110
 
111
  app.launch()