owaski commited on
Commit
2e2aa2d
·
1 Parent(s): 0e9feb4

UI update

Browse files
Files changed (1) hide show
  1. app.py +7 -26
app.py CHANGED
@@ -527,25 +527,15 @@ with gr.Blocks(
527
  (https://github.com/siddhu001/espnet/tree/sds_demo_recipe/egs2/TEMPLATE/sds1#how-to-use).
528
  """
529
  )
 
530
  with gr.Row():
531
  with gr.Column(scale=1):
532
- user_audio = gr.Audio(
533
- sources=["upload", "microphone"],
534
- type="numpy",
535
- label="Upload or Record Audio File",
536
- format="wav",
537
- )
538
  input_text = gr.Textbox(
539
  label="LLM prompt",
540
  visible=True,
541
  interactive=True,
542
  value=default_instruct,
543
  )
544
- type_radio = gr.Radio(
545
- choices=["Cascaded"],
546
- label="Choose type of Spoken Dialog:",
547
- value="Cascaded",
548
- )
549
  ASR_radio = gr.Radio(
550
  choices=ASR_options,
551
  label="Choose ASR:",
@@ -569,6 +559,12 @@ with gr.Blocks(
569
  )
570
  process_btn = gr.Button("Process Audio", variant="primary")
571
  with gr.Column(scale=1):
 
 
 
 
 
 
572
  output_asr_text = gr.Textbox(label="ASR Transcription", interactive=False)
573
  output_text = gr.Textbox(label="LLM Response", interactive=False)
574
  output_audio = gr.Audio(label="TTS Output", autoplay=True, visible=True, interactive=False)
@@ -627,21 +623,6 @@ with gr.Blocks(
627
  fn=handle_ASR_selection_wrapper,
628
  inputs=[ASR_radio],
629
  )
630
- type_radio.change(
631
- fn=dialogue_model.handle_type_selection,
632
- inputs=[type_radio, radio, ASR_radio, LLM_radio],
633
- outputs=[
634
- radio,
635
- ASR_radio,
636
- LLM_radio,
637
- E2Eradio,
638
- output_asr_text,
639
- output_text,
640
- output_audio,
641
- eval_radio,
642
- eval_radio_E2E,
643
- ],
644
- )
645
  output_audio.play(
646
  flash_buttons, [], [natural_response, diversity_response]
647
  )
 
527
  (https://github.com/siddhu001/espnet/tree/sds_demo_recipe/egs2/TEMPLATE/sds1#how-to-use).
528
  """
529
  )
530
+ type_radio = gr.State("Cascaded")
531
  with gr.Row():
532
  with gr.Column(scale=1):
 
 
 
 
 
 
533
  input_text = gr.Textbox(
534
  label="LLM prompt",
535
  visible=True,
536
  interactive=True,
537
  value=default_instruct,
538
  )
 
 
 
 
 
539
  ASR_radio = gr.Radio(
540
  choices=ASR_options,
541
  label="Choose ASR:",
 
559
  )
560
  process_btn = gr.Button("Process Audio", variant="primary")
561
  with gr.Column(scale=1):
562
+ user_audio = gr.Audio(
563
+ sources=["upload", "microphone"],
564
+ type="numpy",
565
+ label="Upload or Record Audio File",
566
+ format="wav",
567
+ )
568
  output_asr_text = gr.Textbox(label="ASR Transcription", interactive=False)
569
  output_text = gr.Textbox(label="LLM Response", interactive=False)
570
  output_audio = gr.Audio(label="TTS Output", autoplay=True, visible=True, interactive=False)
 
623
  fn=handle_ASR_selection_wrapper,
624
  inputs=[ASR_radio],
625
  )
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
626
  output_audio.play(
627
  flash_buttons, [], [natural_response, diversity_response]
628
  )