Spaces:
Running
on
CPU Upgrade
Running
on
CPU Upgrade
Update app.py
Browse filesUpdated app.py code in order to be compliant with Gradio 4.44
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")
|
@@ -187,11 +184,11 @@ if __name__ == "__main__":
|
|
187 |
clr_btn.click(
|
188 |
fn=clear_inputs_and_outputs,
|
189 |
inputs=[],
|
190 |
-
outputs=[
|
191 |
)
|
192 |
prd_btn.click(
|
193 |
fn=predict_accent,
|
194 |
-
inputs=[
|
195 |
outputs=[lbl_output, plt_output],
|
196 |
)
|
197 |
|
|
|
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")
|
|
|
184 |
clr_btn.click(
|
185 |
fn=clear_inputs_and_outputs,
|
186 |
inputs=[],
|
187 |
+
outputs=[src_input, lbl_output, plt_output],
|
188 |
)
|
189 |
prd_btn.click(
|
190 |
fn=predict_accent,
|
191 |
+
inputs=[src_input],
|
192 |
outputs=[lbl_output, plt_output],
|
193 |
)
|
194 |
|