-
Notifications
You must be signed in to change notification settings - Fork 27
/
cli.py
79 lines (56 loc) · 1.91 KB
/
cli.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
# Copyright (c) Meta Platforms, Inc. and affiliates.
# All rights reserved.
# pyre-strict
# This source code is licensed under the license found in the
# LICENSE file in the root directory of this source tree.
"""
Main command-line entry point for 'vocoder' command.
"""
from typing import List, Type
import click
import datasets as datasets # @oss-only
# @fb-only: import langtech.tts.vocoders.datasets as datasets
import models.diffwave as diffwave # @oss-only
# @fb-only: import langtech.tts.vocoders.models.diffwave as diffwave
import models.framework as framework # @oss-only
# @fb-only: import langtech.tts.vocoders.models.framework as framework
import models.parallel_wavegan as parallel_wavegan # @oss-only
# @fb-only: import langtech.tts.vocoders.models.parallel_wavegan as parallel_wavegan
import models.wavegrad as wavegrad # @oss-only
# @fb-only: import langtech.tts.vocoders.models.wavegrad as wavegrad
import models.wavenet as wavenet # @oss-only
# @fb-only: import langtech.tts.vocoders.models.wavenet as wavenet
import models.wavernn as wavernn # @oss-only
# @fb-only: import langtech.tts.vocoders.models.wavernn as wavernn
# List the models available in this repository.
MODELS: List[Type[framework.Vocoder]] = [
wavegrad.WaveGrad,
wavernn.WaveRNN,
wavenet.WaveNet,
diffwave.DiffWave,
parallel_wavegan.ParallelWaveGAN,
]
# Create all the commands available for the models.
MODEL_COMMANDS: List[click.Group] = [
framework.create_model_commands(model) for model in MODELS
]
DATASET_COMMANDS = [
datasets.download_command,
datasets.split_command,
]
@click.group()
def main() -> None:
"""
Vocoder benchmarking CLI.
"""
@main.group("dataset")
def dataset() -> None:
"""
Dataset processing.
"""
for command in DATASET_COMMANDS:
dataset.add_command(command)
for command in MODEL_COMMANDS:
main.add_command(command)
if __name__ == "__main__":
main()