Spaces:
Paused
Paused
Update app.py
Browse files
app.py
CHANGED
@@ -499,6 +499,7 @@ def transcribe_function(stream, new_chunk):
|
|
499 |
return stream, full_text
|
500 |
|
501 |
|
|
|
502 |
def update_map_with_response(history):
|
503 |
if not history:
|
504 |
return ""
|
@@ -678,7 +679,7 @@ def update_images():
|
|
678 |
|
679 |
def clear_state_and_textbox():
|
680 |
conversational_memory.clear()
|
681 |
-
return
|
682 |
|
683 |
with gr.Blocks(theme='Pijush2023/scikit-learn-pijush') as demo:
|
684 |
with gr.Row():
|
@@ -711,7 +712,7 @@ with gr.Blocks(theme='Pijush2023/scikit-learn-pijush') as demo:
|
|
711 |
|
712 |
audio_input = gr.Audio(sources=["microphone"], streaming=True, type='numpy')
|
713 |
# audio_input.stream(transcribe_function, inputs=[state, audio_input], outputs=[state, chat_input], api_name="voice_query_to_text")
|
714 |
-
audio_input.stream(transcribe_function, inputs=[
|
715 |
|
716 |
|
717 |
|
|
|
499 |
return stream, full_text
|
500 |
|
501 |
|
502 |
+
|
503 |
def update_map_with_response(history):
|
504 |
if not history:
|
505 |
return ""
|
|
|
679 |
|
680 |
def clear_state_and_textbox():
|
681 |
conversational_memory.clear()
|
682 |
+
return "", ""
|
683 |
|
684 |
with gr.Blocks(theme='Pijush2023/scikit-learn-pijush') as demo:
|
685 |
with gr.Row():
|
|
|
712 |
|
713 |
audio_input = gr.Audio(sources=["microphone"], streaming=True, type='numpy')
|
714 |
# audio_input.stream(transcribe_function, inputs=[state, audio_input], outputs=[state, chat_input], api_name="voice_query_to_text")
|
715 |
+
audio_input.stream(transcribe_function, inputs=[state, audio_input], outputs=[state, chat_input], api_name="voice_query_to_text").then(clear_state_and_textbox, outputs=[state, chat_input])
|
716 |
|
717 |
|
718 |
|