import gradio as gr from inference import infer import numpy as np spkdict=np.arange(175).tolist() spkdict=['speaker'+str(spk) for spk in spkdict] app = gr.Blocks() with app: with gr.Tabs(): with gr.TabItem("Basic"): gr.Markdown(value=""" """) sid = gr.Dropdown(label="音色",choices=np.arange(175), value=0) vc_audio = gr.Audio(label="上传音频,建议小于2分钟") vc_transform = gr.Number(label="变调(整数,可以正负,半音数量,升高八度就是12)",value='speaker0') vc_submit = gr.Button("转换", variant="primary") vc_output1 = gr.Textbox(label="Output Message") vc_output2 = gr.Audio(label="Output Audio") vc_submit.click(infer, [vc_audio,sid, vc_transform], [vc_output1, vc_output2]) app.launch()