Pendrokar commited on
Commit
8163b97
β€’
1 Parent(s): 6109b39

Submit on Enter press

Browse files
Files changed (1) hide show
  1. app.py +28 -2
app.py CHANGED
@@ -405,7 +405,7 @@ with gr.Blocks(css=".arpabet {display: inline-block; background-color: gray; bor
405
  deepmoji_checkbox = gr.Checkbox(label="Use DeepMoji", info="Auto adjust emotional values", value=True)
406
 
407
  # Event handling using click
408
- btn = gr.Button("Generate")
409
 
410
  with gr.Row(): # Main row for inputs and language selection
411
  with gr.Column(): # Input column
@@ -440,7 +440,33 @@ with gr.Blocks(css=".arpabet {display: inline-block; background-color: gray; bor
440
  happy_slider,
441
  sad_slider,
442
  surprise_slider,
443
- # xVAServer JSON
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
444
  gr.Textbox(visible=False)
445
  ]
446
  )
 
405
  deepmoji_checkbox = gr.Checkbox(label="Use DeepMoji", info="Auto adjust emotional values", value=True)
406
 
407
  # Event handling using click
408
+ btn = gr.Button("Generate", variant="primary")
409
 
410
  with gr.Row(): # Main row for inputs and language selection
411
  with gr.Column(): # Input column
 
440
  happy_slider,
441
  sad_slider,
442
  surprise_slider,
443
+ # xVAServer response
444
+ gr.Textbox(visible=False)
445
+ ]
446
+ )
447
+ input_textbox.submit(
448
+ fn=predict,
449
+ inputs=[
450
+ input_textbox,
451
+ voice_radio,
452
+ language_radio,
453
+ pacing_slider,
454
+ pitch_slider,
455
+ energy_slider,
456
+ anger_slider,
457
+ happy_slider,
458
+ sad_slider,
459
+ surprise_slider,
460
+ deepmoji_checkbox
461
+ ],
462
+ outputs=[
463
+ output_wav,
464
+ output_arpabet,
465
+ anger_slider,
466
+ happy_slider,
467
+ sad_slider,
468
+ surprise_slider,
469
+ # xVAServer response
470
  gr.Textbox(visible=False)
471
  ]
472
  )