Pijush2023 commited on
Commit
ed74dc4
·
verified ·
1 Parent(s): a2f6174

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +0 -67
app.py CHANGED
@@ -649,73 +649,6 @@ def transcribe_function_whisper(audio):
649
 
650
 
651
 
652
- # with gr.Blocks(theme='Pijush2023/scikit-learn-pijush') as demo:
653
- # with gr.Row():
654
- # with gr.Column():
655
- # state = gr.State()
656
-
657
- # chatbot = gr.Chatbot([], elem_id="RADAR:Channel 94.1", bubble_full_width=False)
658
- # choice = gr.Radio(label="Select Style", choices=["Details", "Conversational"], value="Conversational")
659
-
660
- # gr.Markdown("<h1 style='color: red;'>Talk to RADAR</h1>", elem_id="voice-markdown")
661
-
662
- # chat_input = gr.Textbox(show_copy_button=True, interactive=True, show_label=False, label="ASK Radar !!!", placeholder="After Prompt, click Retriever Only")
663
- # chat_msg = chat_input.submit(add_message, [chatbot, chat_input], [chatbot, chat_input], api_name="voice_query")
664
- # tts_choice = gr.Radio(label="Select TTS System", choices=["Alpha", "Beta", "Gamma"], value="Alpha")
665
- # retriever_button = gr.Button("Retriever")
666
-
667
-
668
-
669
- # gr.Markdown("<h1 style='color: red;'>Radar Map</h1>", elem_id="Map-Radar")
670
- # location_output = gr.HTML()
671
- # retriever_button.click(fn=add_message, inputs=[chatbot, chat_input], outputs=[chatbot, chat_input]).then(
672
- # fn=bot, inputs=[chatbot, choice, tts_choice, state], outputs=[chatbot, gr.Audio(interactive=False, autoplay=True)], api_name="Ask_Retriever").then(
673
- # fn=show_map_if_details, inputs=[chatbot, choice], outputs=[location_output, location_output], api_name="map_finder").then(
674
- # fn=clear_state_and_textbox, inputs=[], outputs=[chat_input])
675
-
676
- # bot_msg = chat_msg.then(bot, [chatbot, choice, tts_choice], [chatbot], api_name="generate_voice_response")
677
- # bot_msg.then(lambda: gr.Textbox(value="", interactive=True, placeholder="Ask Radar!!!...", show_label=False), None, [chat_input])
678
- # chatbot.like(print_like_dislike, None, None)
679
- # clear_button = gr.Button("Clear")
680
- # clear_button.click(fn=clear_textbox, inputs=None, outputs=chat_input)
681
-
682
- # # Recorder section
683
-
684
- # gr.Markdown("<h2>Hey Radar</h2>")
685
- # audio_input = gr.Audio(sources=["microphone"], type='numpy')
686
- # transcribe_button = gr.Button("Transcribe")
687
- # transcribe_button.click(fn=transcribe_and_update_textbox, inputs=[audio_input], outputs=[chat_input],api_name="voice_to_text")
688
-
689
-
690
-
691
- # # Streaming ASR component
692
- # gr.Markdown("<h2>Hey Radar ASR</h2>")
693
- # stream_audio_input = gr.Audio(sources=["microphone"], type='numpy', streaming=True)
694
- # stream_transcription = gr.State(None) # Initialize stream state
695
- # stream_audio_input.change(transcribe_function, inputs=[stream_transcription, stream_audio_input], outputs=[stream_transcription, chat_input])
696
-
697
-
698
-
699
-
700
-
701
- # # with gr.Column():
702
- # # weather_output = gr.HTML(value=fetch_local_weather())
703
- # # news_output = gr.HTML(value=fetch_local_news())
704
- # # news_output = gr.HTML(value=fetch_local_events())
705
-
706
- # with gr.Column():
707
- # image_output_1 = gr.Image(value=generate_image(hardcoded_prompt_1), width=400, height=400)
708
- # image_output_2 = gr.Image(value=generate_image(hardcoded_prompt_2), width=400, height=400)
709
- # image_output_3 = gr.Image(value=generate_image(hardcoded_prompt_3), width=400, height=400)
710
-
711
- # refresh_button = gr.Button("Refresh Images")
712
- # refresh_button.click(fn=update_images, inputs=None, outputs=[image_output_1, image_output_2, image_output_3])
713
- # # location_output = gr.HTML()
714
- # bot_msg.then(show_map_if_details, [chatbot, choice], [location_output, location_output], api_name="map_finder")
715
-
716
- # demo.queue()
717
- # demo.launch(share=True)
718
-
719
  def clear_stream_transcription():
720
  return None, ""
721
 
 
649
 
650
 
651
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
652
  def clear_stream_transcription():
653
  return None, ""
654