fix(webui): Make the Advanced Settings visible by default again

- The Advanced Settings contains some very advanced features which users shouldn't tweak, but it also contains important insight into segmentation generations, and the "max tokens per generation segment" feature which users must tweak if they have low VRAM.

- Therefore it's very important that users notice the "Advanced Settings" section so that they can read the VRAM help text and reduce the segment length if they have VRAM issues. So let's make the advanced category visible by default again until a better solution is determined.
This commit is contained in:
Arcitec 2025-09-14 00:35:38 +02:00
parent c266910cc6
commit e185fa1ce7

View File

@ -223,7 +223,7 @@ with gr.Blocks(title="IndexTTS Demo") as demo:
with gr.Row(visible=False) as emo_weight_group: with gr.Row(visible=False) as emo_weight_group:
emo_weight = gr.Slider(label=i18n("情感权重"), minimum=0.0, maximum=1.0, value=0.65, step=0.01) emo_weight = gr.Slider(label=i18n("情感权重"), minimum=0.0, maximum=1.0, value=0.65, step=0.01)
with gr.Accordion(i18n("高级生成参数设置"), open=False,visible=False) as advanced_settings_group: with gr.Accordion(i18n("高级生成参数设置"), open=False, visible=True) as advanced_settings_group:
with gr.Row(): with gr.Row():
with gr.Column(scale=1): with gr.Column(scale=1):
gr.Markdown(f"**{i18n('GPT2 采样设置')}** _{i18n('参数会影响音频多样性和生成速度详见')} [Generation strategies](https://huggingface.co/docs/transformers/main/en/generation_strategies)._") gr.Markdown(f"**{i18n('GPT2 采样设置')}** _{i18n('参数会影响音频多样性和生成速度详见')} [Generation strategies](https://huggingface.co/docs/transformers/main/en/generation_strategies)._")
@ -332,9 +332,9 @@ with gr.Blocks(title="IndexTTS Demo") as demo:
# 切换情感控制选项 # 切换情感控制选项
# 第三个返回值实际没有起作用 # 第三个返回值实际没有起作用
if is_exp: if is_exp:
return gr.update(choices=EMO_CHOICES_EXPERIMENTAL, value=EMO_CHOICES_EXPERIMENTAL[0]), gr.update(visible=True),gr.update(value=example_cases) return gr.update(choices=EMO_CHOICES_EXPERIMENTAL, value=EMO_CHOICES_EXPERIMENTAL[0]), gr.update(value=example_cases)
else: else:
return gr.update(choices=EMO_CHOICES_BASE, value=EMO_CHOICES_BASE[0]), gr.update(visible=False),gr.update(value=example_cases[:-2]) return gr.update(choices=EMO_CHOICES_BASE, value=EMO_CHOICES_BASE[0]), gr.update(value=example_cases[:-2])
emo_control_method.change(on_method_change, emo_control_method.change(on_method_change,
inputs=[emo_control_method], inputs=[emo_control_method],
@ -354,7 +354,7 @@ with gr.Blocks(title="IndexTTS Demo") as demo:
experimental_checkbox.change( experimental_checkbox.change(
on_experimental_change, on_experimental_change,
inputs=[experimental_checkbox], inputs=[experimental_checkbox],
outputs=[emo_control_method, advanced_settings_group,example_table.dataset] # 高级参数Accordion outputs=[emo_control_method, example_table.dataset] # 高级参数Accordion
) )
max_text_tokens_per_segment.change( max_text_tokens_per_segment.change(