Spaces:
Sleeping
Sleeping
Christopher H.
commited on
Update app.py
Browse files
app.py
CHANGED
|
@@ -40,6 +40,8 @@ with gr.Blocks() as demo:
|
|
| 40 |
TEST
|
| 41 |
"""
|
| 42 |
)
|
|
|
|
|
|
|
| 43 |
with gr.Row():
|
| 44 |
with gr.Column():
|
| 45 |
audio = WebRTC(
|
|
@@ -61,9 +63,14 @@ with gr.Blocks() as demo:
|
|
| 61 |
|
| 62 |
audio.on_additional_outputs(
|
| 63 |
fn=handle_additional_outputs,
|
| 64 |
-
outputs=[
|
| 65 |
concurrency_limit=10,
|
| 66 |
queue=True, #False,
|
| 67 |
show_progress="hidden",
|
| 68 |
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 69 |
demo.launch(server_name="0.0.0.0", server_port=7860, share=True)
|
|
|
|
| 40 |
TEST
|
| 41 |
"""
|
| 42 |
)
|
| 43 |
+
|
| 44 |
+
test_state = gr.State()
|
| 45 |
with gr.Row():
|
| 46 |
with gr.Column():
|
| 47 |
audio = WebRTC(
|
|
|
|
| 63 |
|
| 64 |
audio.on_additional_outputs(
|
| 65 |
fn=handle_additional_outputs,
|
| 66 |
+
outputs=[test_state],
|
| 67 |
concurrency_limit=10,
|
| 68 |
queue=True, #False,
|
| 69 |
show_progress="hidden",
|
| 70 |
)
|
| 71 |
+
|
| 72 |
+
gr.on(test_state.change, inputs=[test_state, transcript], outputs=[transcript])
|
| 73 |
+
def state_change(test_state)
|
| 74 |
+
return test_state + [{"role": "assistant", "content": random.choice(possible_responses)}]
|
| 75 |
+
|
| 76 |
demo.launch(server_name="0.0.0.0", server_port=7860, share=True)
|