From a0b46f40593a437abfc551983ee3b1d41a3a319d Mon Sep 17 00:00:00 2001 From: Aki Miyazaki Date: Fri, 7 Mar 2025 02:43:30 +0900 Subject: [PATCH] UnboundLocalError: local variable 'button' referenced before assignment (#126) Co-authored-by: Aki --- backend/fastrtc/stream.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/backend/fastrtc/stream.py b/backend/fastrtc/stream.py index 8162c1a..c2c6c8e 100644 --- a/backend/fastrtc/stream.py +++ b/backend/fastrtc/stream.py @@ -193,11 +193,11 @@ def _generate_default_ui( """ ) with gr.Row(): - if additional_input_components: - with gr.Column(): + with gr.Column(): + if additional_input_components: for component in additional_input_components: component.render() - button = gr.Button("Start Stream", variant="primary") + button = gr.Button("Start Stream", variant="primary") with gr.Column(): output_video = WebRTC( label="Video Stream",