未验证 提交 fab19b7e 编写于 作者: K kinghuin 提交者: GitHub

optimize Parakeet (#762)

上级 9b70b1f3
......@@ -11,7 +11,7 @@ Deep Voice 3是百度研究院2017年发布的端到端的TTS模型(论文录
## 命令行预测
```shell
$ hub run deepvoice3_ljspeech --input_text='Simple as this proposition is, it is necessary to be stated'
$ hub run deepvoice3_ljspeech --input_text='Simple as this proposition is, it is necessary to be stated' --use_gpu True --vocoder griffin-lim
```
## API
......@@ -103,6 +103,7 @@ paddlepaddle >= 1.8.2
paddlehub >= 1.7.0
**NOTE:** 除了python依赖外还必须安装libsndfile库
对于Ubuntu用户,请执行:
```
sudo apt-get install libsndfile1
......
......@@ -60,6 +60,7 @@ if not lack_dependency:
from parakeet.g2p import en
from parakeet.models.deepvoice3 import Encoder, Decoder, PostNet, SpectraNet
from parakeet.models.waveflow import WaveFlowModule
from parakeet.models.deepvoice3.weight_norm_hook import remove_weight_norm
else:
raise ImportError(
"The module requires additional dependencies: %s. You can install parakeet via 'git clone https://github.com/PaddlePaddle/Parakeet && cd Parakeet && pip install -e .' and others via pip install"
......@@ -186,6 +187,12 @@ class DeepVoice3(hub.NLPPredictionModule):
encoder, decoder, postnet)
io.load_parameters(
model=self.tts_model, checkpoint_path=self.tts_checkpoint_path)
for name, layer in self.tts_model.named_sublayers():
try:
remove_weight_norm(layer)
except ValueError:
# this layer has not weight norm hook
pass
self.waveflow = WaveflowVocoder(
config_path=self.waveflow_config_path,
......
......@@ -11,7 +11,7 @@ FastSpeech是基于Transformer的前馈神经网络,作者从encoder-decoder
## 命令行预测
```shell
$ hub run fastspeech_ljspeech --input_text='Simple as this proposition is, it is necessary to be stated'
$ hub run fastspeech_ljspeech --input_text='Simple as this proposition is, it is necessary to be stated' --use_gpu True --vocoder griffin-lim
```
## API
......@@ -104,6 +104,7 @@ paddlepaddle >= 1.8.2
paddlehub >= 1.7.0
**NOTE:** 除了python依赖外还必须安装libsndfile库
对于Ubuntu用户,请执行:
```
sudo apt-get install libsndfile1
......
......@@ -102,6 +102,7 @@ paddlepaddle >= 1.8.2
paddlehub >= 1.7.0
**NOTE:** 除了python依赖外还必须安装libsndfile库
对于Ubuntu用户,请执行:
```
sudo apt-get install libsndfile1
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册