Spaces:
Paused
Paused
Update app.py
Browse files
app.py
CHANGED
@@ -692,23 +692,12 @@ with gr.Blocks(theme='Pijush2023/scikit-learn-pijush') as demo:
|
|
692 |
clear_button = gr.Button("Clear")
|
693 |
clear_button.click(fn=clear_textbox, inputs=None, outputs=chat_input)
|
694 |
|
695 |
-
|
696 |
-
|
697 |
-
|
698 |
-
#p2 audio_input = gr.Audio(sources=["microphone"], streaming=False, type='numpy')
|
699 |
-
#p2 audio_input.change(fn=transcribe_function, inputs=[state, audio_input], outputs=[state, chat_input], api_name="voice_query_to_text")
|
700 |
-
|
701 |
-
#p2 send_chunk_button = gr.Button("Send chunk")
|
702 |
-
#p2 send_chunk_button.click(fn=lambda state: state[1], inputs=[state], outputs=chat_input)
|
703 |
|
|
|
704 |
|
705 |
-
|
706 |
-
transcription_state = gr.State(value="") # Initialize a state to hold the transcribed text
|
707 |
-
|
708 |
-
audio_input.change(fn=transcribe_function, inputs=[transcription_state, audio_input], outputs=[transcription_state, transcription_state])
|
709 |
-
|
710 |
-
send_chunk_button = gr.Button("Send chunk")
|
711 |
-
send_chunk_button.click(fn=lambda transcription_state: transcription_state, inputs=[transcription_state], outputs=chat_input)
|
712 |
|
713 |
|
714 |
|
@@ -736,3 +725,8 @@ demo.launch(share=True)
|
|
736 |
|
737 |
|
738 |
|
|
|
|
|
|
|
|
|
|
|
|
692 |
clear_button = gr.Button("Clear")
|
693 |
clear_button.click(fn=clear_textbox, inputs=None, outputs=chat_input)
|
694 |
|
695 |
+
audio_input = gr.Audio(sources=["microphone"], streaming=True, type='numpy')
|
696 |
+
audio_input.stream(transcribe_function, inputs=[state, audio_input], outputs=[state, chat_input], api_name="voice_query_to_text")
|
|
|
|
|
|
|
|
|
|
|
|
|
697 |
|
698 |
+
|
699 |
|
700 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
701 |
|
702 |
|
703 |
|
|
|
725 |
|
726 |
|
727 |
|
728 |
+
|
729 |
+
|
730 |
+
|
731 |
+
|
732 |
+
|