mod app.py with test.request_api
Browse files
app.py
CHANGED
@@ -1,3 +1,31 @@
|
|
|
|
|
|
|
|
|
|
1 |
import gradio as gr
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2 |
|
3 |
-
gr.Interface
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# import gradio as gr
|
2 |
+
#
|
3 |
+
# gr.Interface.load("models/MIT/ast-finetuned-audioset-10-10-0.4593").launch()
|
4 |
+
|
5 |
import gradio as gr
|
6 |
+
from test import request_api
|
7 |
+
import sys
|
8 |
+
import warnings
|
9 |
+
from fastapi import FastAPI
|
10 |
+
|
11 |
+
# ignore UserWarning
|
12 |
+
warnings.simplefilter("ignore", UserWarning)
|
13 |
+
from test import request_api
|
14 |
+
|
15 |
+
|
16 |
+
title = "MIT-AST test"
|
17 |
+
description = "An audio event classifier trained on the AudioSet dataset to predict audio events from the AudioSet ontology."
|
18 |
+
|
19 |
|
20 |
+
demo = gr.Interface(
|
21 |
+
request_api,
|
22 |
+
inputs=[
|
23 |
+
gr.inputs.Audio(type="filepath"),
|
24 |
+
],
|
25 |
+
outputs=['text'],
|
26 |
+
# examples=examples,
|
27 |
+
title=title,
|
28 |
+
description=description,
|
29 |
+
allow_flagging='never'
|
30 |
+
)
|
31 |
+
demo.launch(enable_queue=True, show_error=True, share=False)
|