Spaces:
Sleeping
Sleeping
| import warnings; warnings.filterwarnings("ignore", message="pkg_resources is deprecated") | |
| import gradio as gr | |
| from pipeline import run_pipeline | |
| import gradio_client, fastapi | |
| print("VERSIONS -> gradio:", gr.__version__, "gradio_client:", gradio_client.__version__, "fastapi:", fastapi.__version__) | |
| def infer(file): | |
| path = getattr(file, "name", file) # gr.File gives a tempfile | |
| return run_pipeline(path, out_style="json") # returns JSON string | |
| demo = gr.Interface( | |
| fn=infer, | |
| inputs=gr.File(label="Upload audio/video (mp3, mp4, wav)"), | |
| outputs=gr.Textbox(label="Result (JSON text)"), # ← was gr.JSON; use Textbox | |
| title="Aphasia Classification", | |
| description="MP3/MP4 → WAV → .cha → JSON → model", | |
| concurrency_limit=1, | |
| ) | |
| if __name__ == "__main__": | |
| demo.launch(server_name="0.0.0.0", server_port=7860, show_error=True, max_threads=1, share=True) # ← share=True | |