Ar4ikov commited on
Commit
c5e3e64
1 Parent(s): 55f31c4

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +10 -7
app.py CHANGED
@@ -52,11 +52,14 @@ def recognize(audio):
52
  return predict(audio_array, sr)
53
 
54
 
55
- with gr.Blocks() as blocks:
56
- audio = gr.Audio(source="microphone", type="numpy", label="Скажите что-нибудь...")
57
- success_button = gr.Button('Распознать эмоции')
58
- output = gr.JSON(label="Эмоции")
 
 
 
 
 
59
 
60
- success_button.click(fn=recognize, inputs=[audio], outputs=[output])
61
-
62
- blocks.launch(enable_queue=True, debug=True)
 
52
  return predict(audio_array, sr)
53
 
54
 
55
+ interface = gr.Interface(
56
+ fn=recognize,
57
+ inputs=[
58
+ gr.Audio(source="microphone", type="numpy", label="Скажите что-нибудь...")
59
+ ],
60
+ outputs=[
61
+ output = gr.JSON(label="Эмоции")
62
+ ],
63
+ live=True)
64
 
65
+ interface.launch(debug=True)