import os os.environ['NUMBA_DISABLE_CACHE'] = '1' import gradio as gr from separation_utils import separate_audio def run_demo(file): bg_path, fg_path = separate_audio(file) return bg_path, fg_path demo = gr.Interface( fn=run_demo, inputs=gr.Audio(type="filepath", label="Upload mixed audio"), outputs=[ gr.Audio(label="Background audio"), gr.Audio(label="Foreground audio") ], title="Speaker Source Separation", description="Upload a mixed audio file. This demo separates foreground and background using the Repet algorithm from the nussl library.", allow_flagging="never" ) if __name__ == "__main__": demo.launch(share=True, server_name="0.0.0.0", server_port=7860)