Skip to content

Commit

Permalink
optimize(webui): unify initial value to ex[0] (#486)
Browse files Browse the repository at this point in the history
  • Loading branch information
fumiama authored Jun 27, 2024
1 parent 6b1fe99 commit c6882ee
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions examples/web/webui.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,37 +21,36 @@ def main():
gr.Markdown("- **GitHub Repo**: https://github.com/2noise/ChatTTS")
gr.Markdown("- **HuggingFace Repo**: https://huggingface.co/2Noise/ChatTTS")

default_text = "四川美食确实以辣闻名,但也有不辣的选择。比如甜水面、赖汤圆、蛋烘糕、叶儿粑等,这些小吃口味温和,甜而不腻,也很受欢迎。"
text_input = gr.Textbox(
label="Input Text",
lines=4,
placeholder="Please Input Text...",
value=default_text,
value=ex[0][0],
interactive=True,
)

with gr.Row():
refine_text_checkbox = gr.Checkbox(
label="Refine text", value=True, interactive=True
label="Refine text", value=ex[0][6], interactive=True
)
temperature_slider = gr.Slider(
minimum=0.00001,
maximum=1.0,
step=0.00001,
value=0.3,
value=ex[0][1],
label="Audio Temperature",
interactive=True,
)
top_p_slider = gr.Slider(
minimum=0.1,
maximum=0.9,
step=0.05,
value=0.7,
value=ex[0][2],
label="top_P",
interactive=True,
)
top_k_slider = gr.Slider(
minimum=1, maximum=20, step=1, value=20, label="top_K", interactive=True
minimum=1, maximum=20, step=1, value=ex[0][3], label="top_K", interactive=True
)

with gr.Row():
Expand All @@ -62,15 +61,15 @@ def main():
interactive=True,
)
audio_seed_input = gr.Number(
value=2,
value=ex[0][4],
label="Audio Seed",
interactive=True,
minimum=seed_min,
maximum=seed_max,
)
generate_audio_seed = gr.Button("\U0001F3B2", interactive=True)
text_seed_input = gr.Number(
value=42,
value=ex[0][5],
label="Text Seed",
interactive=True,
minimum=seed_min,
Expand Down

0 comments on commit c6882ee

Please sign in to comment.