Pijush2023 commited on
Commit
ab6d499
·
verified ·
1 Parent(s): 63193f5

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -5
app.py CHANGED
@@ -638,12 +638,12 @@ with gr.Blocks(theme='Pijush2023/scikit-learn-pijush') as demo:
638
  state = gr.State()
639
 
640
  chatbot = gr.Chatbot([], elem_id="RADAR:Channel 94.1", bubble_full_width=False)
641
- choice = gr.Radio(label="Select Style", choices=["Details", "Conversational"], value="Conversational")
642
 
643
  gr.Markdown("<h1 style='color: red;'>Talk to RADAR</h1>", elem_id="voice-markdown")
644
  chat_input = gr.Textbox(show_copy_button=True, interactive=True, show_label=False, label="ASK Radar !!!")
645
- chat_msg = chat_input.submit(add_message, [chatbot, chat_input], [chatbot, chat_input])
646
- tts_choice = gr.Radio(label="Select TTS System", choices=["Eleven Labs", "Parler-TTS", "MARS5"], value="Eleven Labs")
647
  bot_msg = chat_msg.then(bot, [chatbot, choice, tts_choice], [chatbot, gr.Audio(interactive=False, autoplay=True)])
648
  bot_msg.then(lambda: gr.Textbox(value="", interactive=True, placeholder="Ask Radar!!!...", show_label=False), None, [chat_input])
649
  chatbot.like(print_like_dislike, None, None)
@@ -651,12 +651,12 @@ with gr.Blocks(theme='Pijush2023/scikit-learn-pijush') as demo:
651
  clear_button.click(fn=clear_textbox, inputs=None, outputs=chat_input)
652
 
653
  audio_input = gr.Audio(sources=["microphone"], streaming=True, type='numpy')
654
- audio_input.stream(transcribe_function, inputs=[state, audio_input], outputs=[state, chat_input], api_name="SAMLOne_real_time")
655
 
656
 
657
  gr.Markdown("<h1 style='color: red;'>Map</h1>", elem_id="location-markdown")
658
  location_output = gr.HTML()
659
- bot_msg.then(show_map_if_details, [chatbot, choice], [location_output, location_output])
660
 
661
 
662
  # with gr.Column():
 
638
  state = gr.State()
639
 
640
  chatbot = gr.Chatbot([], elem_id="RADAR:Channel 94.1", bubble_full_width=False)
641
+ choice = gr.Radio(label="Select Style", choices=["Details", "Conversational"], value="Conversational",api_name="ask_retrival")
642
 
643
  gr.Markdown("<h1 style='color: red;'>Talk to RADAR</h1>", elem_id="voice-markdown")
644
  chat_input = gr.Textbox(show_copy_button=True, interactive=True, show_label=False, label="ASK Radar !!!")
645
+ chat_msg = chat_input.submit(add_message, [chatbot, chat_input], [chatbot, chat_input],api_name="voice_query")
646
+ tts_choice = gr.Radio(label="Select TTS System", choices=["Eleven Labs", "Parler-TTS", "MARS5"], value="Eleven Labs",api_name="generate_voice_response)
647
  bot_msg = chat_msg.then(bot, [chatbot, choice, tts_choice], [chatbot, gr.Audio(interactive=False, autoplay=True)])
648
  bot_msg.then(lambda: gr.Textbox(value="", interactive=True, placeholder="Ask Radar!!!...", show_label=False), None, [chat_input])
649
  chatbot.like(print_like_dislike, None, None)
 
651
  clear_button.click(fn=clear_textbox, inputs=None, outputs=chat_input)
652
 
653
  audio_input = gr.Audio(sources=["microphone"], streaming=True, type='numpy')
654
+ audio_input.stream(transcribe_function, inputs=[state, audio_input], outputs=[state, chat_input], api_name="voice_query_to_text")
655
 
656
 
657
  gr.Markdown("<h1 style='color: red;'>Map</h1>", elem_id="location-markdown")
658
  location_output = gr.HTML()
659
+ bot_msg.then(show_map_if_details, [chatbot, choice], [location_output, location_output],api_name="map_finder")
660
 
661
 
662
  # with gr.Column():