parse.py 3.0 KB
Newer Older
L
lifuchen 已提交
1 2 3 4 5 6 7 8 9 10 11 12 13
# Copyright (c) 2020 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
L
lifuchen 已提交
14 15
import argparse

L
lifuchen 已提交
16

L
lifuchen 已提交
17
def add_config_options_to_parser(parser):
L
lifuchen 已提交
18 19 20 21
    parser.add_argument(
        '--config_path',
        type=str,
        default='config/fastspeech.yaml',
L
lifuchen 已提交
22
        help="the yaml config file path.")
L
lifuchen 已提交
23 24 25 26 27 28
    parser.add_argument(
        '--batch_size', type=int, default=32, help="batch size for training.")
    parser.add_argument(
        '--epochs',
        type=int,
        default=10000,
L
lifuchen 已提交
29
        help="the number of epoch for training.")
L
lifuchen 已提交
30 31 32 33
    parser.add_argument(
        '--lr',
        type=float,
        default=0.001,
L
lifuchen 已提交
34
        help="the learning rate for training.")
L
lifuchen 已提交
35 36 37 38
    parser.add_argument(
        '--save_step',
        type=int,
        default=500,
L
lifuchen 已提交
39
        help="checkpointing interval during training.")
L
lifuchen 已提交
40 41 42 43
    parser.add_argument(
        '--fastspeech_step',
        type=int,
        default=70000,
L
lifuchen 已提交
44
        help="Global step to restore checkpoint of fastspeech.")
L
lifuchen 已提交
45 46 47 48
    parser.add_argument(
        '--use_gpu',
        type=int,
        default=1,
L
lifuchen 已提交
49
        help="use gpu or not during training.")
L
lifuchen 已提交
50 51 52 53
    parser.add_argument(
        '--use_data_parallel',
        type=int,
        default=0,
L
lifuchen 已提交
54
        help="use data parallel or not during training.")
55 56 57 58
    parser.add_argument(
        '--alpha',
        type=float,
        default=1.0,
59 60
        help="The hyperparameter to determine the length of the expanded sequence \
                mel, thereby controlling the voice speed.")
L
lifuchen 已提交
61

L
lifuchen 已提交
62 63 64 65
    parser.add_argument(
        '--data_path',
        type=str,
        default='./dataset/LJSpeech-1.1',
L
lifuchen 已提交
66
        help="the path of dataset.")
L
lifuchen 已提交
67 68 69 70
    parser.add_argument(
        '--checkpoint_path',
        type=str,
        default=None,
L
lifuchen 已提交
71
        help="the path to load checkpoint or pretrain model.")
L
lifuchen 已提交
72 73 74 75
    parser.add_argument(
        '--save_path',
        type=str,
        default='./checkpoint',
L
lifuchen 已提交
76
        help="the path to save checkpoint.")
L
lifuchen 已提交
77 78 79 80
    parser.add_argument(
        '--log_dir',
        type=str,
        default='./log',
L
lifuchen 已提交
81
        help="the directory to save tensorboard log.")
L
lifuchen 已提交
82 83 84 85
    parser.add_argument(
        '--sample_path',
        type=str,
        default='./sample',
L
lifuchen 已提交
86
        help="the directory to save audio sample in synthesis.")
L
lifuchen 已提交
87 88 89 90
    parser.add_argument(
        '--transtts_path',
        type=str,
        default='./log',
L
lifuchen 已提交
91
        help="the directory to load pretrain transformerTTS model.")
L
lifuchen 已提交
92 93 94 95
    parser.add_argument(
        '--transformer_step',
        type=int,
        default=160000,
L
lifuchen 已提交
96
        help="the step to load transformerTTS model.")