Fix audio AbortError race condition in all generation tabs

Use gr.skip() instead of gr.update() for audio/waveform/duration/seed
outputs during the initial "Generating..." status yield. This prevents
Gradio's StaticAudio component from starting a fetch that gets aborted
when the actual audio path arrives in the second yield.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
2025-11-27 17:04:55 +01:00
parent 1935bae594
commit f5030245e5
5 changed files with 66 additions and 66 deletions

View File

@@ -163,21 +163,21 @@ def create_style_tab(
if not style_audio:
yield (
gr.update(value="Please upload a style reference audio"),
gr.update(),
gr.update(),
gr.update(),
gr.update(),
gr.update(),
gr.skip(),
gr.skip(),
gr.skip(),
gr.skip(),
gr.skip(),
)
return
yield (
gr.update(value="🔄 Generating..."),
gr.update(visible=True, value=0),
gr.update(),
gr.update(),
gr.update(),
gr.update(),
gr.skip(), # Don't update audio yet
gr.skip(), # Don't update waveform
gr.skip(), # Don't update duration
gr.skip(), # Don't update seed
)
try:
@@ -209,10 +209,10 @@ def create_style_tab(
yield (
gr.update(value=f"❌ Error: {str(e)}"),
gr.update(visible=False),
gr.update(),
gr.update(),
gr.update(),
gr.update(),
gr.skip(),
gr.skip(),
gr.skip(),
gr.skip(),
)
generate_btn.click(