From b6eb73dea41e28480c28a7a6048cc09d74591146 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Kr=C3=BCger?= Date: Wed, 26 Nov 2025 23:16:39 +0100 Subject: [PATCH] Fix async generator syntax errors in tab files MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Changed return statements to yield + return in async generator functions. Python doesn't allow 'return' with a value in generators. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude --- src/ui/tabs/audiogen_tab.py | 3 ++- src/ui/tabs/jasco_tab.py | 3 ++- src/ui/tabs/magnet_tab.py | 3 ++- src/ui/tabs/musicgen_tab.py | 3 ++- src/ui/tabs/style_tab.py | 3 ++- 5 files changed, 10 insertions(+), 5 deletions(-) diff --git a/src/ui/tabs/audiogen_tab.py b/src/ui/tabs/audiogen_tab.py index 78e1acd..f84c105 100644 --- a/src/ui/tabs/audiogen_tab.py +++ b/src/ui/tabs/audiogen_tab.py @@ -161,7 +161,7 @@ def create_audiogen_tab( prompt, variant, duration, temperature, cfg_coef, top_k, top_p, seed ): if not prompt: - return ( + yield ( gr.update(value="Please enter a prompt"), gr.update(), gr.update(), @@ -169,6 +169,7 @@ def create_audiogen_tab( gr.update(), gr.update(), ) + return yield ( gr.update(value="🔄 Generating..."), diff --git a/src/ui/tabs/jasco_tab.py b/src/ui/tabs/jasco_tab.py index bfa74b8..c382e0f 100644 --- a/src/ui/tabs/jasco_tab.py +++ b/src/ui/tabs/jasco_tab.py @@ -217,7 +217,7 @@ def create_jasco_tab( prompt, variant, chords, drums, duration, bpm, temperature, cfg_coef, top_k, top_p, seed ): if not chords: - return ( + yield ( gr.update(value="Please enter a chord progression"), gr.update(), gr.update(), @@ -225,6 +225,7 @@ def create_jasco_tab( gr.update(), gr.update(), ) + return yield ( gr.update(value="🔄 Generating..."), diff --git a/src/ui/tabs/magnet_tab.py b/src/ui/tabs/magnet_tab.py index f4312b9..c7516bb 100644 --- a/src/ui/tabs/magnet_tab.py +++ b/src/ui/tabs/magnet_tab.py @@ -184,7 +184,7 @@ def create_magnet_tab( prompt, variant, duration, temperature, cfg_coef, top_k, top_p, decoding_steps, span_arr, seed ): if not prompt: - return ( + yield ( gr.update(value="Please enter a prompt"), gr.update(), gr.update(), @@ -192,6 +192,7 @@ def create_magnet_tab( gr.update(), gr.update(), ) + return yield ( gr.update(value="🔄 Generating..."), diff --git a/src/ui/tabs/musicgen_tab.py b/src/ui/tabs/musicgen_tab.py index e6a26ce..c6dd751 100644 --- a/src/ui/tabs/musicgen_tab.py +++ b/src/ui/tabs/musicgen_tab.py @@ -189,7 +189,7 @@ def create_musicgen_tab( prompt, variant, duration, temperature, cfg_coef, top_k, top_p, seed, melody ): if not prompt: - return ( + yield ( gr.update(value="Please enter a prompt"), gr.update(), gr.update(), @@ -197,6 +197,7 @@ def create_musicgen_tab( gr.update(), gr.update(), ) + return # Update status yield ( diff --git a/src/ui/tabs/style_tab.py b/src/ui/tabs/style_tab.py index 621d6d2..5bcdec9 100644 --- a/src/ui/tabs/style_tab.py +++ b/src/ui/tabs/style_tab.py @@ -161,7 +161,7 @@ def create_style_tab( prompt, variant, style_audio, duration, temperature, cfg_coef, top_k, top_p, seed ): if not style_audio: - return ( + yield ( gr.update(value="Please upload a style reference audio"), gr.update(), gr.update(), @@ -169,6 +169,7 @@ def create_style_tab( gr.update(), gr.update(), ) + return yield ( gr.update(value="🔄 Generating..."),