Spaces:
Build error
Build error
Update app.py
Browse files
app.py
CHANGED
|
@@ -90,17 +90,17 @@ def predict_dnn(input):
|
|
| 90 |
print(f"Prediction: {prediction}")
|
| 91 |
return prediction
|
| 92 |
|
| 93 |
-
def main(model):
|
| 94 |
if model == "DNN":
|
| 95 |
-
return predict_dnn(
|
| 96 |
elif model == "RandomForest":
|
| 97 |
-
return predict_rf(
|
| 98 |
|
| 99 |
|
| 100 |
-
|
| 101 |
-
|
| 102 |
-
main,
|
| 103 |
inputs=[
|
|
|
|
| 104 |
gr.Audio(sources=["microphone","upload"], type="filepath")
|
| 105 |
],
|
| 106 |
outputs=[
|
|
@@ -108,6 +108,6 @@ with gr.Blocks() as demo:
|
|
| 108 |
],
|
| 109 |
live=True,
|
| 110 |
description="demo for Audio to question classifier"
|
| 111 |
-
|
| 112 |
|
| 113 |
-
|
|
|
|
| 90 |
print(f"Prediction: {prediction}")
|
| 91 |
return prediction
|
| 92 |
|
| 93 |
+
def main(model, audio):
|
| 94 |
if model == "DNN":
|
| 95 |
+
return predict_dnn(audio)
|
| 96 |
elif model == "RandomForest":
|
| 97 |
+
return predict_rf(audio)
|
| 98 |
|
| 99 |
|
| 100 |
+
iface = gr.Interface(
|
| 101 |
+
fn = main,
|
|
|
|
| 102 |
inputs=[
|
| 103 |
+
gr.Dropdown(choices=model_names),
|
| 104 |
gr.Audio(sources=["microphone","upload"], type="filepath")
|
| 105 |
],
|
| 106 |
outputs=[
|
|
|
|
| 108 |
],
|
| 109 |
live=True,
|
| 110 |
description="demo for Audio to question classifier"
|
| 111 |
+
)
|
| 112 |
|
| 113 |
+
iface.launch()
|