# app.py import gradio as gr from pipeline import run_pipeline def infer(file): path = getattr(file, "name", file) # gr.File or str return run_pipeline(path, out_style="json") demo = gr.Interface( fn=infer, inputs=gr.File(label="Upload audio/video (mp3, mp4, wav)"), outputs=gr.JSON(label="Result"), # safer than Code for 4.44.0 bug title="Aphasia Classification", description="MP3/MP4 → WAV → .cha → JSON → model" ) if __name__ == "__main__": demo.queue(concurrency_count=1, max_size=8) demo.launch(server_name="0.0.0.0", server_port=7860, show_error=True)