import gradio as gr from inference import infer def vc_fn(sid,random1, input_audio,vc_transform): return "Success", (22050, audio) app = gr.Blocks() with app: with gr.Tabs(): with gr.TabItem("Basic"): gr.Markdown(value=""" """) sid = gr.Dropdown(label="音色",choices=['speaker0'], value="speaker0") vc_input3 = gr.Audio(label="上传音频,建议小于2分钟") vc_transform = gr.Number(label="变调(整数,可以正负,半音数量,升高八度就是12)",value=0) vc_submit = gr.Button("转换", variant="primary") vc_output1 = gr.Textbox(label="Output Message") vc_output2 = gr.Audio(label="Output Audio") vc_submit.click(vc_fn, [sid,random1, vc_input3, vc_transform], [vc_output1, vc_output2]) app.launch()