import gradio as gr def calculate_mos_difference(ref_file, deg_file): ref_mos = pesq.pesq(ref_file, ref_file, 'wb') deg_mos = pesq.pesq(ref_file, deg_file, 'wb') mos_difference = ref_mos - deg_mos return mos_difference audio_inputs = [ gr.inputs.Audio(label="Reference Audio"), gr.inputs.Audio(label="Degraded Audio") ] output = gr.outputs.Textbox(label="MOS Value Difference") gr.Interface(fn=calculate_mos_difference, inputs=audio_inputs, outputs=output).launch()