File size: 608 Bytes
36fdb7a
01e1c01
5908912
6b63af7
5908912
36fdb7a
 
71166dd
5908912
 
36fdb7a
 
5908912
36fdb7a
5908912
71166dd
 
36fdb7a
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
# 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)