Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -28,7 +28,7 @@ def audio_postprocess(self, y):
|
|
28 |
|
29 |
gr.Audio.postprocess = audio_postprocess
|
30 |
def create_vc_fn(model, sid):
|
31 |
-
def vc_fn(input_audio, vc_transform, auto_f0):
|
32 |
if input_audio is None:
|
33 |
return "You need to upload an audio", None
|
34 |
sampling_rate, audio = input_audio
|
@@ -44,7 +44,7 @@ def create_vc_fn(model, sid):
|
|
44 |
soundfile.write(raw_path, audio, 16000, format="wav")
|
45 |
raw_path.seek(0)
|
46 |
out_audio, out_sr = model.infer(sid, vc_transform, raw_path,
|
47 |
-
auto_predict_f0=auto_f0,
|
48 |
)
|
49 |
return "Success", (44100, out_audio.cpu().numpy())
|
50 |
return vc_fn
|
@@ -84,12 +84,13 @@ if __name__ == '__main__':
|
|
84 |
vc_input = gr.Audio(label="Input audio"+' (less than 20 seconds)' if limitation else '')
|
85 |
vc_transform = gr.Number(label="vc_transform", value=0)
|
86 |
auto_f0 = gr.Checkbox(label="auto_f0", value=False)
|
|
|
87 |
vc_submit = gr.Button("Generate", variant="primary")
|
88 |
|
89 |
with gr.Column():
|
90 |
vc_output1 = gr.Textbox(label="Output Message")
|
91 |
vc_output2 = gr.Audio(label="Output Audio")
|
92 |
-
vc_submit.click(vc_fn, [vc_input, vc_transform, auto_f0], [vc_output1, vc_output2])
|
93 |
|
94 |
"""
|
95 |
for category, link in others.items():
|
|
|
28 |
|
29 |
gr.Audio.postprocess = audio_postprocess
|
30 |
def create_vc_fn(model, sid):
|
31 |
+
def vc_fn(input_audio, vc_transform, auto_f0, fmp):
|
32 |
if input_audio is None:
|
33 |
return "You need to upload an audio", None
|
34 |
sampling_rate, audio = input_audio
|
|
|
44 |
soundfile.write(raw_path, audio, 16000, format="wav")
|
45 |
raw_path.seek(0)
|
46 |
out_audio, out_sr = model.infer(sid, vc_transform, raw_path,
|
47 |
+
auto_predict_f0=auto_f0, f0_mean_pooling=fmp
|
48 |
)
|
49 |
return "Success", (44100, out_audio.cpu().numpy())
|
50 |
return vc_fn
|
|
|
84 |
vc_input = gr.Audio(label="Input audio"+' (less than 20 seconds)' if limitation else '')
|
85 |
vc_transform = gr.Number(label="vc_transform", value=0)
|
86 |
auto_f0 = gr.Checkbox(label="auto_f0", value=False)
|
87 |
+
fmp = gr.Checkbox(label="fmp", value=False)
|
88 |
vc_submit = gr.Button("Generate", variant="primary")
|
89 |
|
90 |
with gr.Column():
|
91 |
vc_output1 = gr.Textbox(label="Output Message")
|
92 |
vc_output2 = gr.Audio(label="Output Audio")
|
93 |
+
vc_submit.click(vc_fn, [vc_input, vc_transform, auto_f0, fmp], [vc_output1, vc_output2])
|
94 |
|
95 |
"""
|
96 |
for category, link in others.items():
|