Skip to content
This repository has been archived by the owner on Sep 11, 2022. It is now read-only.

Commit

Permalink
select device when synthesize
Browse files Browse the repository at this point in the history
  • Loading branch information
yt605155624 committed Oct 13, 2021
1 parent f53b3f9 commit 29babf0
Show file tree
Hide file tree
Showing 11 changed files with 49 additions and 13 deletions.
11 changes: 10 additions & 1 deletion docs/src/demo.rst
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,10 @@ Analysis/synthesis
Audio samples generated from ground-truth spectrograms with a vocoder.

.. raw:: html


<b>LJSpeech(English)</b>
<br>
</br>
<table>
<tr>
<th align="left"> GT </th>
Expand Down Expand Up @@ -101,6 +104,12 @@ Audio samples generated from ground-truth spectrograms with a vocoder.
</td>
</tr>
</table>

<br>
</br>
<b>CSMSC(Chinese)</b>
<br>
</br>

<table>
<tr>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,9 @@ def main():
parser.add_argument("--verbose", type=int, default=1, help="verbose.")

args = parser.parse_args()

paddle.set_device(args.device)

config = get_cfg_default()
if args.config:
config.merge_from_file(args.config)
Expand Down
3 changes: 3 additions & 0 deletions examples/fastspeech2/aishell3/synthesize_e2e.py
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,9 @@ def main():
parser.add_argument("--verbose", type=int, default=1, help="verbose.")

args = parser.parse_args()

paddle.set_device(args.device)

with open(args.fastspeech2_config) as f:
fastspeech2_config = CfgNode(yaml.safe_load(f))
with open(args.pwg_config) as f:
Expand Down
3 changes: 3 additions & 0 deletions examples/fastspeech2/baker/synthesize_e2e.py
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,9 @@ def main():
parser.add_argument("--verbose", type=int, default=1, help="verbose.")

args = parser.parse_args()

paddle.set_device(args.device)

with open(args.fastspeech2_config) as f:
fastspeech2_config = CfgNode(yaml.safe_load(f))
with open(args.pwg_config) as f:
Expand Down
3 changes: 3 additions & 0 deletions examples/fastspeech2/ljspeech/synthesize_e2e.py
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,9 @@ def main():
parser.add_argument("--verbose", type=int, default=1, help="verbose.")

args = parser.parse_args()

paddle.set_device(args.device)

with open(args.fastspeech2_config) as f:
fastspeech2_config = CfgNode(yaml.safe_load(f))
with open(args.pwg_config) as f:
Expand Down
3 changes: 3 additions & 0 deletions examples/fastspeech2/synthesize.py
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,9 @@ def main():
parser.add_argument("--verbose", type=int, default=1, help="verbose.")

args = parser.parse_args()

paddle.set_device(args.device)

with open(args.fastspeech2_config) as f:
fastspeech2_config = CfgNode(yaml.safe_load(f))
with open(args.pwg_config) as f:
Expand Down
24 changes: 12 additions & 12 deletions examples/speedyspeech/baker/conf/default.yaml
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
###########################################################
# FEATURE EXTRACTION SETTING #
###########################################################
fs: 24000 # Sampling rate.
n_fft: 2048 # FFT size.
n_shift: 300 # Hop size.
win_length: 1200 # Window length.
# If set to null, it will be the same as fft_size.
window: "hann" # Window function.
n_mels: 80 # Number of mel basis.
fmin: 80 # Minimum freq in mel basis calculation.
fmax: 7600 # Maximum frequency in mel basis calculation.
fs: 24000 # Sampling rate.
n_fft: 2048 # FFT size.
n_shift: 300 # Hop size.
win_length: 1200 # Window length.
# If set to null, it will be the same as fft_size.
window: "hann" # Window function.
n_mels: 80 # Number of mel basis.
fmin: 80 # Minimum freq in mel basis calculation.
fmax: 7600 # Maximum frequency in mel basis calculation.

###########################################################
# DATA SETTING #
###########################################################
batch_size: 256
batch_size: 32
num_workers: 4

###########################################################
Expand All @@ -35,13 +35,13 @@ model:
###########################################################
optimizer:
optim: adam # optimizer type
learning_rate: 0.008 # learning rate
learning_rate: 0.001 # learning rate
max_grad_norm: 5.0

###########################################################
# TRAINING SETTING #
###########################################################
max_epoch: 600
max_epoch: 300
num_snapshots: 5

###########################################################
Expand Down
3 changes: 3 additions & 0 deletions examples/speedyspeech/baker/synthesize_e2e.py
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,9 @@ def main():
parser.add_argument("--verbose", type=int, default=1, help="verbose")

args, _ = parser.parse_known_args()

paddle.set_device(args.device)

with open(args.speedyspeech_config) as f:
speedyspeech_config = CfgNode(yaml.safe_load(f))
with open(args.pwg_config) as f:
Expand Down
3 changes: 3 additions & 0 deletions examples/speedyspeech/synthesize.py
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,9 @@ def main():
parser.add_argument("--verbose", type=int, default=1, help="verbose")

args, _ = parser.parse_known_args()

paddle.set_device(args.device)

with open(args.speedyspeech_config) as f:
speedyspeech_config = CfgNode(yaml.safe_load(f))
with open(args.pwg_config) as f:
Expand Down
3 changes: 3 additions & 0 deletions examples/transformer_tts/ljspeech/synthesize_e2e.py
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,9 @@ def main():
parser.add_argument("--verbose", type=int, default=1, help="verbose.")

args = parser.parse_args()

paddle.set_device(args.device)

with open(args.transformer_tts_config) as f:
transformer_tts_config = CfgNode(yaml.safe_load(f))
with open(args.waveflow_config) as f:
Expand Down
3 changes: 3 additions & 0 deletions examples/transformer_tts/synthesize.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,9 @@ def main():
parser.add_argument("--verbose", type=int, default=1, help="verbose.")

args = parser.parse_args()

paddle.set_device(args.device)

with open(args.transformer_tts_config) as f:
transformer_tts_config = CfgNode(yaml.safe_load(f))
with open(args.waveflow_config) as f:
Expand Down

0 comments on commit 29babf0

Please sign in to comment.