ttt-tkmr commited on
Commit
f8ad6dd
1 Parent(s): e90456c

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -8
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(input)
96
  elif model == "RandomForest":
97
- return predict_rf(input)
98
 
99
 
100
- with gr.Blocks() as demo:
101
- model = gr.Dropdown(choices=model_names),
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
- demo.launch()
 
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()