Commit 133a86eb authored by chenpangpang's avatar chenpangpang
Browse files

feat: gradio页面改成中文;优化提示

parent 82635a15
......@@ -147,27 +147,25 @@ with gr.Blocks(css=css) as block:
)
gr.HTML(
f"""
<p><a href="https://github.com/huggingface/parler-tts"> Parler-TTS</a> is a training and inference library for
high-fidelity text-to-speech (TTS) models.</p>
<p>The models demonstrated here, Parler-TTS <a href="https://huggingface.co/parler-tts/parler-tts-mini-v1">Mini v1</a> and <a href="https://huggingface.co/parler-tts/parler-tts-large-v1">Large v1</a>,
are trained using 45k hours of narrated English audiobooks. It generates high-quality speech
with features that can be controlled using a simple text prompt (e.g. gender, background noise, speaking rate, pitch and reverberation).</p>
<p><a href="https://github.com/huggingface/parler-tts"> Parler-TTS</a> 是一个用于高保真文本转语音 (TTS) 模型的训练和推理库。</p>
<p>这里展示的模型 Parler-TTS <a href="https://huggingface.co/parler-tts/parler-tts-mini-v1">Mini v1</a> 和 <a href="https://huggingface.co/parler-tts/parler-tts-large-v1">Large v1</a>
是使用 45000 小时的英语有声读物进行训练的。它可以生成高质量的语音,并且可以使用简单的文本提示来控制其功能(例如性别、背景噪音、语速、音调和混响)。</p>
<p>By default, Parler-TTS generates 🎲 random voice. To ensure 🎯 <b> speaker consistency </b> across generations, these checkpoints were also trained on 34 speakers, characterized by name (e.g. Jon, Lea, Gary, Jenna, Mike, Laura).</p>
<p>默认情况下,Parler-TTS会生成 🎲随机语音。为了确保 🎯 <b>说话者在生成过程中的一致性</b>, 这些模型还针对34位说话者进行了训练,并以姓名为特征(例如 JonLeaGaryJennaMikeLaura)。</p>
<p>To take advantage of this, simply adapt your text description to specify which speaker to use: `Jon's voice is monotone...`</p>
<p>要利用此功能,只需调整文本描述以指定要使用的说话者: `Jon's voice is monotone...`</p>
"""
)
with gr.Row():
with gr.Column():
input_text = gr.Textbox(label="Input Text", lines=2, value=default_text, elem_id="input_text")
description = gr.Textbox(label="Description", lines=2, value=default_description,
input_text = gr.Textbox(label="输入文本", lines=2, value=default_text, elem_id="input_text")
description = gr.Textbox(label="描述", lines=2, value=default_description,
elem_id="input_description")
use_large = gr.Checkbox(value=False, label="Use Large checkpoint",
info="Generate with Parler-TTS Large v1 instead of Mini v1 - Better but way slower.")
run_button = gr.Button("Generate Audio", variant="primary")
use_large = gr.Checkbox(value=False, label="使用Large模型",
info="使用Parler-TTS Large v1生成效果更好;使用Mini v1生成速度更快")
run_button = gr.Button("生成音频", variant="primary")
with gr.Column():
audio_out = gr.Audio(label="Parler-TTS generation", type="numpy", elem_id="audio_out")
audio_out = gr.Audio(label="Parler-TTS生成", type="numpy", elem_id="audio_out")
inputs = [input_text, description, use_large]
outputs = [audio_out]
......@@ -175,20 +173,19 @@ with gr.Blocks(css=css) as block:
gr.Examples(examples=examples, fn=gen_tts, inputs=inputs, outputs=outputs, cache_examples=True)
gr.HTML(
"""
<p>Tips for ensuring good generation:
<p>提示:
<ul>
<li>Include the term "very clear audio" to generate the highest quality audio, and "very noisy audio" for high levels of background noise</li>
<li>Punctuation can be used to control the prosody of the generations, e.g. use commas to add small breaks in speech</li>
<li>The remaining speech features (gender, speaking rate, pitch and reverberation) can be controlled directly through the prompt</li>
<li>文本中包含"very clear audio"以生成最高质量的音频, 以及"very noisy audio"以产生高水平的背景噪音</li>
<li>标点符号可用于控制代际韵律,例如可以使用逗号在语音中添加小停顿</li>
<li>其余语音特征(性别、语速、音调和混响)可以通过文本直接控制</li>
</ul>
</p>
<p>Parler-TTS can be much faster. We give some tips on how to generate much more quickly in this <a href="https://github.com/huggingface/parler-tts/blob/main/INFERENCE.md"> inference guide</a>. Think SDPA, torch.compile, batching and streaming!</p>
<p>Parler-TTS可以更快。 在<a href="https://github.com/huggingface/parler-tts/blob/main/INFERENCE.md"> 推理指南</a>给出了一些快速生成的方法,包括SDPA, torch.compile, batching and streaming!</p>
<p>If you want to find out more about how this model was trained and even fine-tune it yourself, check-out the
<a href="https://github.com/huggingface/parler-tts"> Parler-TTS</a> repository on GitHub.</p>
<p> 如果您想了解有关如何训练该模型的更多信息,甚至对其进行微调,请查看 GitHub 上
<a href="https://github.com/huggingface/parler-tts"> Parler-TTS</a> repository</p>
<p>The Parler-TTS codebase and its associated checkpoints are licensed under <a href='https://github.com/huggingface/parler-tts?tab=Apache-2.0-1-ov-file#readme'> Apache 2.0</a>.</p>
"""
)
......
......@@ -7,41 +7,29 @@
"tags": []
},
"source": [
"## 说明\n",
"- 启动需要加载模型,需要3分钟左右的时间\n",
"## 项目介绍\n",
"\n",
"- 原项目地址:https://huggingface.co/spaces/parler-tts/parler_tts\n",
"- parler-tts:一款使用简单文本提示即可生成高保真语音的工具\n",
"## 使用说明\n",
"- 启动和重启 Notebook 点上方工具栏中的「重启并运行所有单元格」。出现如下内容就算成功了:\n",
" - `Running on local URL: http://0.0.0.0:7860`\n",
" - `Running on public URL: https://xxxxxxxxxxxxxxx.gradio.live`\n",
"- 通过以下方式开启页面:\n",
" - 加载模型需要3分钟左右时间,请耐心等待\n",
" - 控制台打开「自定义服务」了,访问自定义服务端口号设置为7860\n",
" - 直接打开显示的公开链接`public URL`\n",
"\n",
"## 功能介绍\n",
"- 原项目地址:https://huggingface.co/spaces/parler-tts/parler_tts\n",
"- parler-tts:一款使用简单文本提示即可生成高保真语音的工具"
"\n"
]
},
{
"cell_type": "code",
"execution_count": 1,
"execution_count": null,
"id": "53a96614-e2d2-4710-a82b-0d5ca9cb9872",
"metadata": {
"tags": [],
"ExecuteTime": {
"end_time": "2024-08-19T02:28:47.760610Z",
"start_time": "2024-08-19T02:28:47.612252Z"
}
"tags": []
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"start.sh: line 3: cd: /root/Tile-Upscaler: No such file or directory\r\n",
"python: can't open file '/Users/chenyihang/work/project/parler-tts-build/app.py': [Errno 2] No such file or directory\r\n"
]
}
],
"outputs": [],
"source": [
"# 启动\n",
"!sh start.sh"
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment