Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -250,10 +250,13 @@ with gr.Blocks(theme="rawrsor1/Everforest") as demo:
|
|
250 |
clear_state_btn = gr.Button("Clear State")
|
251 |
audio_output = gr.Audio(label="Response Audio", type="filepath", autoplay=True, interactive=False)
|
252 |
|
|
|
|
|
|
|
253 |
# Update the transcription text in real-time as the user speaks
|
254 |
audio_input.stream(
|
255 |
-
fn=transcribe_function,
|
256 |
-
inputs=
|
257 |
outputs=[None, transcription_textbox, transcription_textbox]
|
258 |
)
|
259 |
|
|
|
250 |
clear_state_btn = gr.Button("Clear State")
|
251 |
audio_output = gr.Audio(label="Response Audio", type="filepath", autoplay=True, interactive=False)
|
252 |
|
253 |
+
# Initialize the stream as an empty array for the first input
|
254 |
+
stream = np.array([])
|
255 |
+
|
256 |
# Update the transcription text in real-time as the user speaks
|
257 |
audio_input.stream(
|
258 |
+
fn=lambda new_chunk: transcribe_function(stream, new_chunk),
|
259 |
+
inputs=audio_input,
|
260 |
outputs=[None, transcription_textbox, transcription_textbox]
|
261 |
)
|
262 |
|