Skip to content

Commit 46ccc57

Browse files
committed
v1.1.15 workaround for gr.Accordion default open=False bug (#1239)
1 parent 39617fc commit 46ccc57

File tree

2 files changed

+13
-2
lines changed

2 files changed

+13
-2
lines changed

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
44

55
[project]
66
name = "f5-tts"
7-
version = "1.1.12"
7+
version = "1.1.15"
88
description = "F5-TTS: A Fairytaler that Fakes Fluent and Faithful Speech with Flow Matching"
99
readme = "README.md"
1010
license = {text = "MIT License"}

src/f5_tts/infer/infer_gradio.py

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,7 @@ def infer(
221221
)
222222
gen_text_file = gr.File(label="Load Text to Generate from File (.txt)", file_types=[".txt"], scale=1)
223223
generate_btn = gr.Button("Synthesize", variant="primary")
224-
with gr.Accordion("Advanced Settings", open=False):
224+
with gr.Accordion("Advanced Settings", open=True) as adv_settn:
225225
with gr.Row():
226226
ref_text_input = gr.Textbox(
227227
label="Reference Text",
@@ -269,6 +269,17 @@ def infer(
269269
info="Set the duration of the cross-fade between audio clips.",
270270
)
271271

272+
def collapse_accordion():
273+
return gr.Accordion(open=False)
274+
275+
# Workaround for https://github.com/SWivid/F5-TTS/issues/1239#issuecomment-3677987413
276+
# i.e. to set gr.Accordion(open=True) by default, then collapse manually Blocks loaded
277+
app_tts.load(
278+
fn=collapse_accordion,
279+
inputs=None,
280+
outputs=adv_settn,
281+
)
282+
272283
audio_output = gr.Audio(label="Synthesized Audio")
273284
spectrogram_output = gr.Image(label="Spectrogram")
274285

0 commit comments

Comments
 (0)