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:
@@ -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(
|
||||
|
||||
Reference in New Issue
Block a user