Spaces:
Paused
Paused
Update app.py
Browse files
app.py
CHANGED
@@ -748,19 +748,18 @@ with gr.Blocks(theme='Pijush2023/scikit-learn-pijush') as demo:
|
|
748 |
clear_button = gr.Button("Clear")
|
749 |
clear_button.click(fn=clear_textbox, inputs=None, outputs=chat_input)
|
750 |
|
751 |
-
#
|
752 |
-
|
753 |
-
|
754 |
-
|
755 |
-
|
756 |
-
# transcribe_button.click(fn=transcribe_and_update_textbox, inputs=[audio_input], outputs=[chat_input], api_name="voice_to_text")
|
757 |
|
758 |
|
759 |
# Streaming ASR component
|
760 |
gr.Markdown("<h2>Streaming ASR</h2>")
|
761 |
stream_audio_input = gr.Audio(sources=["microphone"], type='numpy', streaming=True)
|
762 |
stream_transcription = gr.State(None) # Initialize stream state
|
763 |
-
stream_audio_input.change(transcribe_function, inputs=[stream_transcription, stream_audio_input], outputs=[stream_transcription, chat_input])
|
764 |
|
765 |
# Add the clear button for ASR history
|
766 |
clear_btn = gr.Button("Clear ASR ")
|
|
|
748 |
clear_button = gr.Button("Clear")
|
749 |
clear_button.click(fn=clear_textbox, inputs=None, outputs=chat_input)
|
750 |
|
751 |
+
# New ASR Component with Whisper
|
752 |
+
gr.Markdown("<h2>Hey Radar</h2>")
|
753 |
+
audio_input_whisper = gr.Audio(sources=["microphone"], type='numpy')
|
754 |
+
transcribe_button_whisper = gr.Button("Transcribe")
|
755 |
+
transcribe_button_whisper.click(fn=transcribe_function_whisper, inputs=[audio_input_whisper], outputs=[chat_input], api_name="whisper_asr")
|
|
|
756 |
|
757 |
|
758 |
# Streaming ASR component
|
759 |
gr.Markdown("<h2>Streaming ASR</h2>")
|
760 |
stream_audio_input = gr.Audio(sources=["microphone"], type='numpy', streaming=True)
|
761 |
stream_transcription = gr.State(None) # Initialize stream state
|
762 |
+
stream_audio_input.change(transcribe_function, inputs=[stream_transcription, stream_audio_input], outputs=[stream_transcription, chat_input],api_name="text_to_voice")
|
763 |
|
764 |
# Add the clear button for ASR history
|
765 |
clear_btn = gr.Button("Clear ASR ")
|