Update app.py
Browse filesUpdating Gradio code to be compatible with the latest version
app.py
CHANGED
@@ -155,10 +155,7 @@ if __name__ == "__main__":
|
|
155 |
with gr.Row():
|
156 |
## Input
|
157 |
with gr.Column():
|
158 |
-
|
159 |
-
upl_input = gr.Audio(
|
160 |
-
source="upload", type="filepath", label="Upload a wav file"
|
161 |
-
)
|
162 |
|
163 |
with gr.Row():
|
164 |
clr_btn = gr.Button(value="Clear", variant="secondary")
|
@@ -175,11 +172,11 @@ if __name__ == "__main__":
|
|
175 |
clr_btn.click(
|
176 |
fn=clear_inputs_and_outputs,
|
177 |
inputs=[],
|
178 |
-
outputs=[
|
179 |
)
|
180 |
prd_btn.click(
|
181 |
fn=predict_accent,
|
182 |
-
inputs=[
|
183 |
outputs=[lbl_output, plt_output],
|
184 |
)
|
185 |
|
|
|
155 |
with gr.Row():
|
156 |
## Input
|
157 |
with gr.Column():
|
158 |
+
src_input = gr.Audio(sources=["microphone", "upload"])
|
|
|
|
|
|
|
159 |
|
160 |
with gr.Row():
|
161 |
clr_btn = gr.Button(value="Clear", variant="secondary")
|
|
|
172 |
clr_btn.click(
|
173 |
fn=clear_inputs_and_outputs,
|
174 |
inputs=[],
|
175 |
+
outputs=[src_input, lbl_output, plt_output],
|
176 |
)
|
177 |
prd_btn.click(
|
178 |
fn=predict_accent,
|
179 |
+
inputs=[src_input],
|
180 |
outputs=[lbl_output, plt_output],
|
181 |
)
|
182 |
|