Skip to content

Commit

Permalink
Merge pull request #1752 from yt605155624/fix_wavernn
Browse files Browse the repository at this point in the history
[TTS]fix wavernn white noise bug for paddle develop(2.3)
  • Loading branch information
yt605155624 authored Apr 22, 2022
2 parents 32a75cd + 08a4673 commit 9121dfc
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
4 changes: 2 additions & 2 deletions examples/csmsc/tts3/local/synthesize_e2e.sh
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,6 @@ if [ ${stage} -le 4 ] && [ ${stop_stage} -ge 4 ]; then
--lang=zh \
--text=${BIN_DIR}/../sentences.txt \
--output_dir=${train_output_path}/test_e2e \
--phones_dict=dump/phone_id_map.txt #\
# --inference_dir=${train_output_path}/inference
--phones_dict=dump/phone_id_map.txt \
--inference_dir=${train_output_path}/inference
fi
1 change: 1 addition & 0 deletions examples/csmsc/voc6/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,7 @@ The pretrained model can be downloaded here:

The static model can be downloaded here:
- [wavernn_csmsc_static_0.2.0.zip](https://paddlespeech.bj.bcebos.com/Parakeet/released_models/wavernn/wavernn_csmsc_static_0.2.0.zip)
- [wavernn_csmsc_static_1.0.0.zip](https://paddlespeech.bj.bcebos.com/Parakeet/released_models/wavernn/wavernn_csmsc_static_1.0.0.zip) (fix bug for paddle 2.3)

Model | Step | eval/loss
:-------------:|:------------:| :------------:
Expand Down
4 changes: 3 additions & 1 deletion paddlespeech/t2s/models/wavernn/wavernn.py
Original file line number Diff line number Diff line change
Expand Up @@ -360,7 +360,9 @@ def generate(self,
x = sample.transpose([1, 0, 2])

elif self.mode == 'RAW':
posterior = F.softmax(logits, axis=1)
# fix bug for paddle 2.3, see https://github.com/PaddlePaddle/Paddle/commit/01f606b4f1ca3e184a59111084ed460ee0798a5a
# posterior = F.softmax(logits, axis=1)
posterior = logits
distrib = paddle.distribution.Categorical(posterior)
# corresponding operate [np.floor((fx + 1) / 2 * mu + 0.5)] in enocde_mu_law
# distrib.sample([1])[0].cast('float32'): [0, 2**bits-1]
Expand Down

0 comments on commit 9121dfc

Please sign in to comment.