Ellie5757575757's picture
Update app.py
5908912 verified
raw
history blame
547 Bytes
import gradio as gr
from pipeline import run_pipeline
def infer(file):
# file is a tempfile-like object from Gradio
return run_pipeline(file.name, out_style="json")
demo = gr.Interface(
fn=infer,
inputs=gr.Audio(sources=["upload", "microphone"], type="filepath"), # accepts mp3/mp4/wav; ffmpeg handles it
outputs=gr.Code(label="Result (JSON)"),
title="Aphasia Classification",
description="Upload audio/video; pipeline: ffmpeg → .cha → JSON → model → result."
)
if __name__ == "__main__":
demo.launch()