|
6 | 6 |
|
7 | 7 | options: |
8 | 8 | --num_workers=<n> Num workers. |
| 9 | + --hparams=<parmas> Hyper parameters [default: ]. |
9 | 10 | -h, --help Show help message. |
10 | 11 | """ |
11 | 12 | from docopt import docopt |
12 | 13 | import os |
13 | 14 | from multiprocessing import cpu_count |
14 | 15 | from tqdm import tqdm |
15 | 16 | import importlib |
16 | | -from hparams import hparams |
| 17 | +from hparams import hparams, hparams_debug_string |
17 | 18 |
|
18 | 19 |
|
19 | 20 | def preprocess(mod, in_dir, out_root, num_workers): |
@@ -42,6 +43,19 @@ def write_metadata(metadata, out_dir): |
42 | 43 | num_workers = args["--num_workers"] |
43 | 44 | num_workers = cpu_count() if num_workers is None else int(num_workers) |
44 | 45 |
|
| 46 | + # Override hyper parameters |
| 47 | + hparams.parse(args["--hparams"]) |
| 48 | + print(hparams_debug_string()) |
| 49 | + assert hparams.name == "deepvoice3" |
| 50 | + |
| 51 | + # Presets |
| 52 | + if hparams.preset is not None and hparams.preset != "": |
| 53 | + preset = hparams.presets[hparams.preset] |
| 54 | + import json |
| 55 | + hparams.parse_json(json.dumps(preset)) |
| 56 | + print("Override hyper parameters with preset \"{}\": {}".format( |
| 57 | + hparams.preset, json.dumps(preset, indent=4))) |
| 58 | + |
45 | 59 | assert name in ["jsut", "ljspeech", "vctk"] |
46 | 60 | mod = importlib.import_module(name) |
47 | 61 | preprocess(mod, in_dir, out_dir, num_workers) |
0 commit comments